Programming to display a running text on the OLEDUsing TMS320C5515 eZDSPTM USB StickAssoc. Prof. Dr. Thuong Le TienThis report introduces the LCD module on the TMS320C5515 eZDSPTM USB Stick Development Tool. It also outlines basic steps to configure and use the module to display a desired running text.
Digital Signal Processing LAB REPORT Programming to display a running text on the OLED Using TMS320C5515 eZDSPTM USB Stick Instructor: Assoc Prof Dr Thuong Le -Tien Teaching Asisstants: Chi Hieu, Quoc Huy Group 7: Dat Nguyen-Si ID: ILI11006 In-class ID: Trung Le ID: 41103857 In-class ID: March, 7th 2014 Vietnam National University Ho Chi Minh City University of Technology Lab report Table of Contents March, 7th 2014 Lab report Abstract This report introduces the LCD module on the TMS320C5515 eZDSPTM USB Stick Development Tool It also outlines basic steps to configure and use the module to display a desired running text March, 7th 2014 Lab report Introduction The LCD module in the TMS320C5515 eZDSPTM USB Stick Development Tool is a 96×16 monochrome OLED display screen LCD can be a very useful part in any microcontroller based project It helps to monitor variables and program status with simple texts or numbers TMS320C5515 eZdsp™ USB Stick Development Tool’s LCD module To learn how to use the OLED, we refer to the existing sample codes in the lcd-osd9616 project The modifications are mainly done in the oled_test.c source code Additional information about how to configure the LCD module is got from the SSD1306.pdf acquired from this link: www.adafruit.com/datasheets/SSD1306.pdf This driver allows us to: - Set contrast control Turn on the display Set normal/ inverse display Using various scrolling modes Set indexes for different addressing modes Further hardware configurations ( display start line, segment re-map, etc) Set timing and driving scheme ( Clock, Pre-charge Period, etc) Personal settings are shown in the Source codes section March, 7th 2014 Lab report Display a character on the OLED Our OLED has 96x16 pixels (96 columns x 16 rows) which can demonstrate rows of texts( 96x8 pixels for each row) Based on the existing oled_test.c file, we can design our own characters To show a character, the OLED need 5x8 pixels However, since we need spaces between adjacent characters and rows, only 4x7 pixels are available for designing An 8-bit hexadecimal number is used to expressed an 8-bit column Due to former conventional programming (can be re-defined), the hex codes are counted from the most left to most right column For example, if we want to display a “1” on the OLED ( as being shown below) , the required hex codes is {0x40, 0x7F, 0x42, 0x00} start from here Bit Bit Bit Bit Bit Bit Bit Bit left blank left blank To print out a certain character, we use the subroutine printLetter in the oled_test.c file: Int16 printLetter(Uint16 l1,Uint16 l2,Uint16 l3,Uint16 l4) { OSD9616_send(0x40,l1); OSD9616_send(0x40,l2); OSD9616_send(0x40,l3); OSD9616_send(0x40,l4); OSD9616_send(0x40,0x00); } return 0; As we can see, the subroutine automatically prints additional 1x8 pixels ( a blank column ), so we not need to care about the fifth blank column March, 7th 2014 Lab report In this LAB, because the space available for each letter is limited, some characters are not properly sketched However, it is just an aesthetic matter We can still recognize the desired letters March, 7th 2014 Lab report Display a running text on the OLED Based on above technics, we designed various letters to make the required text: - “Chương Trình Đào Tạo Quốc Tế – Lớp Tiên Tiến CT11 – Group – Thursday 27 Feb, 2014” on the 1st row “Department of Electrical – Electronics Engineering – Ho Chi Minh City University of Technology – Engineering Education” on the 2nd row Using the same method as being shown in the sample codes, we can make the text scroll vertically or horizontally The vertical scroll is fine, the full texts could be shown However, due to the limitation of memory, we only have 128 columns each page ( we have pages in total), and we cannot display the full text with horizontal scroll Therefore, we tried a different method to display the full text We only used pages ( page 0) with no scrolling effect We displayed a short piece of text( which fits 96 columns), delayed second, then displayed the next piece of text and repeat the sequence until the full texts are shown Here are the steps: Initialize page Print a short text on the OLED Print additional 30 blanks to ensure the remaining screen space is filled Delay second Reinitalize page Repeat steps to until the required texts are finished Using this method, the texts are not really “running” They just apear in turn We tried a different method to to this task ( which is presented later in the Conclusion section) However, due to the lack of time, we did not manage to complete the idea Therefore, only the complete codes are shown in this report March, 7th 2014 Lab report Source codes In this source code, for convenience, we print each letter from left to right Compare to the sample code, there are difference: The printLetter subroutine is modified so that it prints from left to right Segment re-map is set from to 95: OSD9616_send(0x00,0xa0); Scrolling settings are neglected Note: actually, the modification of printLetter is not necessary Instead, we can reverse all the hex codes we have made However, this step requires much more efforts to Also, we keep the old hex codes to easily compare the work with our friends The the oled_test.c is modified as follows: #include"usbstk5515.h" #include"usbstk5515_i2c.h" #include"usbstk5515_gpio.h" #include"lcd.h" #define OSD9616_I2C_ADDR 0x3C // OSD9616 I2C address /* * * * * Int16 OSD9616_send( Uint16 comdat, Uint16 data ) * * * * Sends bytes of data to the OSD9616 * * * * */ Int16 OSD9616_send( Uint16 comdat, Uint16 data ) { Uint8 cmd[2]; cmd[0] = comdat & 0x00FF; // Specifies whether data is Command or Data cmd[1] = data; // Command / Data return USBSTK5515_I2C_write( OSD9616_I2C_ADDR, cmd, ); } /* * * * * Int16 OSD9616_multiSend( Uint16 comdat, Uint16 data ) * * * Sends multiple bytes of data to the OSD9616 * * * */ Int16 OSD9616_multiSend( Uint8* data, Uint16 len ) { Uint16 x; Uint8 cmd[10]; for(x=0;x