ATmega8 talking to uOLED-160-GMD1

With renewed enthusiasm I have progressed on the coding of my RetroTAC project.

Today’s result: my little Atmel ATmega8 is telling the 4D Systems uOLED-160-GMD1 where to go! Or rather, what to say.


Using the ATmega’s USART hardware serial port, controlled in software by some USART routines written by Mihai Galos, I wrote a subroutine based on the OLED’s user manual entry for writing strings of ASCII text to the screen.

UOLED_fstring('s', 0x00, 0x00, 0x02, 0xFF, 0xFF, "Hello Interwebs");

The above is the line in the main code that sends the options to the subroutine. I’ve just realised while writing this that the first variable ‘s’ is actually not necessary as the subroutine is specific for that command.

void UOLED_fstring( unsigned char cmd, unsigned char col, unsigned char row, unsigned char font, unsigned char msb, unsigned char lsb, unsigned char *c )
{
USART_Transmit(cmd);
USART_Transmit(col);
USART_Transmit(row);
USART_Transmit(font);
USART_Transmit(msb);
USART_Transmit(lsb);
sendString_USART(c);
USART_Transmit(0x00);
}

The above is the subroutine. As mentioned, the first line ‘cmd’ is actually redundant and I will change it to always send ASCII ‘s’ / 0×73 which is the OLED’s command to print a string of formatted text.

Next up, I’ll expand this to display a short demo menu of options and code the keypad input to control the display – giving the basics of a User Interface.

0 Responses to “ATmega8 talking to uOLED-160-GMD1”


  • No Comments

Leave a Reply

*