Step 4Building the interface (hardware)
Connect the LCD to the microcontroller
I would love to tell you what pins need to be connected to what but every LCD has it's own pinout. You can find the right way to do it in your datasheet.
When working with graphical LCD's, I'll always us port A for the data pins and the higher part of port C for the control pins. That leaves me portc.0 and portc.1 for I2C communications.
Don't forget to add the 10K potentiometer between Vee , V0 and Vss for brightness adjustment .
My LCD had an internal resistor for the LED so I just hooked it up to 5V and GND. You could ofcourse connect the LED with one of the PWM pins on your microcontroller to controle the brightness, but I didn't opt for that.
Connect the DS1307 to the microcontroller
Connect pin 5 of the DS1307 to portc.1 of the microcontroller ande pin 6 to portc.0. Don't forget to add the two 4K7 pullup-resistors to those lines. Add the crystal to pin 1 and pin 2 of the DS1307 and add the batteryholder between pin 3 (positive) and pin 4 (negative). Then hookup pin 8 to 5V and pin 4 to GND.
Connect the rotary encoder to the microcontroller
The pushbutton will have 2 pins on your rotary encoder and the encoder itself will have 3 pins. Connect one pin of the pushbutton to INT0 or portd.2 on the microcontroller and the other pin to GND. Then connect the middle of the 3 other pins to GND, one to INT1 or portd.3 and the last one to portd.4.
All the lines to the microcontroller need a 1K5 pullup-resistor.
Connect your microcontroller to the RS232 pins on the router
If you look at the pins on the router, you will notice that one of them is connected to a thick diagonal trace. That pin is 3,3V and lets call it pin 1. Pin 4 is GND, pin 2 is RX and pin3 is TX.
Connect RX to TDX on your microcontroller (portd.1) and TX to RDX (portd.0). But because our microcontroller needs 5V and the router 3,3V, We'll need a level converter. You can learn how to build one in one of my other instructables or you can buy one online.
Don't forget to add your programming link.
That is all we need to start programming the interface.
| « Previous Step | Download PDFView All Steps | Next Step » |
3
comments
|
Add Comment
|
janw (author)
says:
janw (author)
says:
![]() |
Add Comment
|
























































