Connecting CFA 634 to ATMEGA16

Kaze105

New member
Hello, I currently have a ATMEGA16 microcontroller. I wish to output things written in the printf statements in the ATMEGA16 onto the LCD.


I have a MAX233A driver connecting the data-in pin from the lcd to T2out pin 18 on the MAX233A. I also have the T2IN pin 1 on the MAX233A connected to the PORTD.1 of the ATMEGA16.

I should have them connected properly, but I am having trouble getting it to display what I want.

I am wondering if someone could provide a sample code for the ATMEGA16 to just display something. If the LCD can be directly connected to the ATMEGA, please do describe how to do this.

Thanks
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

Kaze105

New member
after reading the instructions, I jumped JPE and JPB and directly connected Data_IN to TX port of the ATMEGA16.

I did write some very basic printf statements, but nothing is displayed except the cursor blinking. Any idea?
 

CF Tech

Administrator
If you are going through the MAX232, you want JPB open and JPE open.



Be sure to match the baud rates (a register in the Atmel, DIP switches on the module). Use 8 data, no parity, 1 stop.

Program the Atmel to send a "U" every 1/10 second. Use your scope to watch the data.

Please let me know if any of that helps.
 

Attachments

Kaze105

New member
If you are going through the MAX232, you want JPB open and JPE open.



Be sure to match the baud rates (a register in the Atmel, DIP switches on the module). Use 8 data, no parity, 1 stop.

Program the Atmel to send a "U" every 1/10 second. Use your scope to watch the data.

Please let me know if any of that helps.
When you say "U", do you mean like

printf("U")
followed by a delay?

Edit: If I dont use the MAX232, I can connect Data_In directly to the port on the ATMEGA16 with JPB and JPE closed, is that correct?
 

Kaze105

New member
Tested it out and the output from the ATMEGA16 comes out fine, but nothing is displayed on the LCD still. Here is the code I used.

Code:
void main(void) 
{ 


DDRB = 0x00;                 //Set PORTB for Input
PORTB = 0xFF;                //Set the pull-up resistors to high impeadance

DDRA=0xFF; 
 

UCSRA=0x00; 
UCSRB=0x08; 
UCSRC=0x86; 
UBRRH=0x00; 
UBRRL=0x26;

        
 


while (1) {    


    printf("U");
    delay_ms(10);




}
}
 
Last edited:

Kaze105

New member
Works fine when I connect it to the Serial to PC. When I try to display something, it just continuously shows brackets and then blanks. Like this excluding parenthesis (]]]]]]]]]]]]]]]]]]]]]]]]]]]]])

Any idea for this?

Edit: After I let it keep showing the brackets, it displays a 3x5 filled box continuously.
 

Kaze105

New member
baud rate may have been the problem. It is now showing U as indicated in the code. The problem now is that a long row of brackets appear first. AFter a while, the code I entered will show.
 
USB LCD Displays - Graphic and Character LCDs with a Keypad
Top