Professional Documents
Culture Documents
Contents
Abstract ................................................................................................. 2
Introduction........................................................................................... 2
Theory ................................................................................................... 3
Source codes ......................................................................................... 4
Comments ........................................................................................... 12
Conclusion .......................................................................................... 13
References ........................................................................................... 14
Abstract
The TMDX5515eZDSP is a small form factor, very low-cost
USB-powered DSP development tool which includes all the
hardware and software needed to evaluate the industry’s
lowest power 16-bit DSP: TMS320C5515. This tool is
similar to TMDX5505eZdsp in the form factor but provides
more evaluation options such as USB2.0 and SD interface.
The USB port provides enough power to operate the ultra-
low-power C5515 so no external power supply is required.
This ultralow-cost tool allows quick and easy evaluation of
the advanced capabilities of the C5515, C5514, C5505A and
C5504A processors. This tool has embedded XDS100
emulator for full source level debug capability and supports
Code
Composer Studio4.0™ integrated development environment
(IDE) and eXpressDSP™ software which includes the
DSP/BIOS™ kernel. The TMDX5515eZDSP has a range of
signal processing applications, including voice recorder, musical instruments, portable medical
solutions and other consumer electronics in industrial and security applications.
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.
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.
Theory
Our OLED has 96x16 pixels (96 columns x 16 rows) which can demonstrate 2 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 8bit hexadecimal number is used
to express 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:{0x40, 0x7F, 0x42, 0x00}
To print out a certain character, we use the subroutine printLetter in the oled_test.c file:
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. Based on
above technics, we designed various letters to make the required text:
“ Lập trình C5515-35 ứng dụng vào Xử Lí Số Tín HiệuNhóm 2 Nguyễn Đông Hải, Trần Tiến Nam –
Trường ĐHBK TpHCM.”
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, and we cannot display the full text with horizontal
scroll.
Source codes
#include"usbstk5515.h"
#include"usbstk5515_i2c.h"
#include"usbstk5515_gpio.h"
#include"lcd.h"
/* ------------------------------------------------------------------------ *
* *
* 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<len;x++) // Command / Data
{
cmd[x] = data[x];
}
return USBSTK5515_I2C_write( OSD9616_I2C_ADDR, cmd, len );
}
/* ------------------------------------------------------------------------ *
* *
* Int16 printLetter(Uint16 l1,Uint16 l2,Uint16 l3,Uint16 l4) *
* *
* Send 4 bytes representing a Character *
* *
* ------------------------------------------------------------------------ */
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;
}
/* ------------------------------------------------------------------------ *
* *
* Int16 oled_test() *
* *
* Testing function for the OSD9616 display *
* *
* ------------------------------------------------------------------------ */
Int16 oled_test()
{
Int16 i;
Uint8 cmd[10]; // For multibyte commands
/* Initialize I2C */
USBSTK5515_I2C_init( );
/* Fill page 0 */
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+0); // Set page for page 0 to page 5
for(i=0;i<128;i++)
{
OSD9616_send(0x40,0x00);
}
/* Write to page 0 */
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+0); // Set page for page 0 to page 5
for(i=0;i<9;i++)
{
OSD9616_send(0x40,0x00); // Spaces
}
printLetter(0x00,0xF8,0x98,0xB8); //g
printLetter(0x00,0x38,0x08,0x38); //n
printLetter(0x00,0x38,0xA0,0x38); //u.
printLetter(0x3E,0x28,0x38,0x00); //d
printLetter(0xF8,0x98,0xB8,0x00); //g
printLetter(0x38,0x08,0x38,0x00); //n
printLetter(0x04,0x39,0x22,0x38); //U?'
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0x3A,0x2A,0x2E,0x00); //5
printLetter(0x3E,0x2A,0x2A,0x00); //3
printLetter(0x08,0x08,0x08,0x08); //-
printLetter(0x3A,0x2A,0x2E,0x00); //5
printLetter(0x00,0x3E,0x00,0x00); //1
printLetter(0x3A,0x2A,0x2E,0x00); //5
printLetter(0x3A,0x2A,0x2E,0x00); //5
printLetter(0x00,0x22,0x22,0x3E); //C
printLetter(0x00,0x38,0x08,0x3E); //h
printLetter(0x38,0x08,0x38,0x00); //n
printLetter(0x00,0x02,0x39,0x00); //i`
printLetter(0x00,0x18,0x08,0x38); //r
printLetter(0x00,0x02,0x3E,0x02); //T
printLetter(0x00,0x38,0x28,0xF8); //p
printLetter(0x00,0x32,0x89,0x32); //â.
printLetter(0x00,0x20,0x20,0x3E); //L
//////////////////////////////////////////////////////////////////////////////////
// PAGE 1
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+1); // Set page for page 0 to page 5
for(i=0;i<128;i++)
{
OSD9616_send(0x40,0x00);
}
/* Write to page 1 */
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+1); // Set page for page 0 to page 5
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0x00,0x38,0x20,0x38); //u
printLetter(0x00,0x5A,0x59,0x7A); //ê.
printLetter(0x80,0x00,0x38,0x00); //i
printLetter(0x3E,0x08,0x3E,0x00); //H
printLetter(0x00,0x38,0x08,0x38); //n
printLetter(0x01,0x02,0x38,0x00); //i'
printLetter(0x02,0x3E,0x02,0x00); //T
printLetter(0x00,0x00,0x02,0x04); //'
printLetter(0x3A,0x29,0x3A,0x00); //ô
printLetter(0x3A,0x2A,0x2C,0x00); //S
printLetter(0xF9,0xA2,0x38,0x00); //y'
printLetter(0x20,0x20,0x3E,0x00); //L
printLetter(0x04,0x38,0x23,0x39); //u?
printLetter(0x36,0x08,0x36,0x00); //X
printLetter(0x00,0x38,0x28,0x38); //o
printLetter(0x00,0x30,0x0A,0x31); //a`
printLetter(0x00,0x18,0x20,0x18); //v
////////////////////////////////////////////////////////////////////////////////////
/* Fill page 2*/
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+2); // Set page for page 0 to page 5
for(i=0;i<128;i++)
{
OSD9616_send(0x36,0x00);
}
/* Write to page 1*/
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+2); // Set page for page 0 to page 5
for(i=0;i<37;i++)
{
OSD9616_send(0x40,0x00); // Spaces
}
printLetter(0xB8,0xA8,0xA8,0xE8); //2
printLetter(0x00,0x00,0x00,0xF0); //
printLetter(0x10,0xF0,0x10,0xF0); //m
printLetter(0xF2,0x94,0xF0,0x00); //o'
printLetter(0xE0,0x20,0xF8,0x00); //h
printLetter(0xF8,0x60,0x30,0xF8); //N
for(i=0;i<40;i++)
{
OSD9616_send(0x40,0x00); // Spaces
}
///////////////////////////////////////////////////////////////////
// PAGE 3
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+3); // Set page for page 0 to page 5
for(i=0;i<128;i++)
{
OSD9616_send(0x40,0x00);
}
/* Write to page 0 */
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+3); // Set page for page 0 to page 5
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0x00,0xF8,0x00,0x00); //I
printLetter(0xF0,0x2B,0x29,0xF0); //A?
printLetter(0xF8,0x20,0xF8,0x00); //H
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0xE8,0xA8,0x88,0xF8); //G
printLetter(0xF8,0x60,0x30,0xF8); //N
printLetter(0x00,0xFA,0x89,0xFA); //O^
printLetter(0x70,0x88,0xA8,0xF8); //-D
printLetter(0x20,0x00,0x00,0x00); //
printLetter(0xF8,0x60,0x30,0xF8); //N
printLetter(0xAA,0xA9,0x3FA,0x00); //E^
printLetter(0x39,0xC2,0x39,0x02); //Y~
printLetter(0x00,0xF8,0x80,0xF8); //U
printLetter(0xE8,0xA8,0x88,0xF8); //G
printLetter(0xF8,0x60,0x30,0xF8); //N
//////////////////////////////////////////////////////////////////////
//PAGE 4
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+4); // Set page for page 0 to page 5
for(i=0;i<128;i++)
{
OSD9616_send(0x40,0x00);
}
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+4); // Set page for page 0 to page 5
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0x00,0x00,0x00,0xF8); //
printLetter(0x30,0x60,0x30,0xF8); //M
printLetter(0xF0,0x28,0x28,0xF0); //A
printLetter(0xF8,0x60,0x30,0xF8); //N
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0xF8,0x60,0x31,0xFA); //N
printLetter(0x00,0xAA,0xA9,0xFA); //E^
printLetter(0x00,0xF8,0x00,0x00); //I'
printLetter(0x08,0xF8,0x08,0x00); //T
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0xF8,0x60,0x30,0xF8); //N
printLetter(0xF0,0x2A,0x29,0xF2); //A^
printLetter(0x00,0x18,0x08,0xF8); //R
printLetter(0x00,0x08,0xF8,0x08); //T
//////////////////////////////////////////////////////////////////////
//PAGE 5
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+5); // Set page for page 0 to page 5
for(i=0;i<128;i++)
{
OSD9616_send(0x40,0x00);
}
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+5); // Set page for page 0 to page 5
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0x00,0x00,0x00,0x00); //
printLetter(0x00,0x00,0x00,0x3E); //
printLetter(0x0C,0x18,0x0C,0x3E); //M
printLetter(0x22,0x22,0x3E,0x00); //C
printLetter(0x3E,0x08,0x3E,0x00); //H
printLetter(0x38,0x28,0xF8,0x00); //P
printLetter(0x00,0x02,0x3E,0x02); //T
printLetter(0x00,0x36,0x08,0x3E); //K
printLetter(0x1C,0x2A,0x2A,0x3E); //B
printLetter(0x3E,0x08,0x3E,0x00); //H
printLetter(0x1C,0x22,0x2A,0x3E); //-D
printLetter(0x08,0x00,0x00,0x00); //
printLetter(0x00,0xF8,0xA8,0x38); //g
printLetter(0x00,0x38,0x08,0x38); //n
printLetter(0x04,0x38,0x28,0x38); //o
printLetter(0x04,0x38,0x22,0x39); //u
printLetter(0x00,0x18,0x08,0x38); //r
printLetter(0x00,0x02,0x3E,0x02); //T
//////////////////////////////////////////////////////////////////////
//PAGE 6
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+6); // Set page for page 0 to page 5
for(i=0;i<128;i++)
{
OSD9616_send(0x40,0x00);
}
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+6); // Set page for page 0 to page 5
//////////////////////////////////////////////////////////////////////
//PAGE 7
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+7); // Set page for page 0 to page 5
for(i=0;i<128;i++)
{
OSD9616_send(0x40,0x00);
}
/* Write to page 0 */
OSD9616_send(0x00,0x00); // Set low column address
OSD9616_send(0x00,0x10); // Set high column address
OSD9616_send(0x00,0xb0+7); // Set page for page 0 to page 5
//////////////////////////////////////////////////////////////////////
/* Set vertical and horizontal scrolling */
cmd[0] = 0x00;
cmd[1] = 0x2a; // Vertical and Right Horizontal Scroll
cmd[2] = 0x00; // Dummy byte
cmd[3] = 0x00; // Define start page address
cmd[4] = 0x03; // Set time interval between each scroll step
cmd[5] = 0x00; // Define end page address
cmd[6] = 0x01; // Vertical scrolling offset
OSD9616_multiSend( cmd, 7 );
OSD9616_send(0x00,0x2f);
/* Keep first 8 rows from vertical scrolling */
cmd[0] = 0x00;
cmd[1] = 0xa3; // Set Vertical Scroll Area
cmd[2] = 0x00; // Set No. of rows in top fixed area
cmd[3] = 0x40; // Set No. of rows in scroll area
OSD9616_multiSend( cmd, 4 );
return 0;
}
Comments
the LCD-oled of TMS320C5515 have 8 pages which scroll vertically. Each page have 128 columns
because of this we have to use 6 pages to illustrate full the text above. Due to the data sheet, the first
page was defined horizontal scroll so that we can not adjust the first page sroll vertically like the
other pages.
By default, the text is just right aligned, to center we can use the command to create a space to align
the text
printLetter(0x00,0x00,0x00,0x00);
Also, we can create plenty of space without repeating the command by using for loop. For example
the following code create 9 empty pixel:
for(i=0;i<9;i++)
{
OSD9616_send(0x40,0x00);
}
Follow the source code above we separate the text into 6 pages, specifically:
Page 0: “Lập trình C5515-35 ứng dụng”
Page 1: “vào Xử Lý Tín Hiệu”
Page 2: “Nhóm 2”
Page 3: “Nguyễn Đông Hải”
Page 4: “Trần Tiến Nam”
Page 5: “Trường ĐHBK TpHCM”
Page 6 and 7 are left blank
Conclusion
After finishing this project, we are able to display and run the require texts on OLED, and successfully
display all the characters on the OLED screen.
References
[1] Texas Instruments, C5515 eZDSP USB Stick Development Tool description and features,
http://www.ti.com/tool/tmdx5515ezdsp, retrieved on October, 19th 2020.
[2] Sensorasia,TMS320C5515_eZdip_USBstick.MP4,http://www.youtube.com/watch?v=ZFnvH1i
ZoY8, retrieved on October, 19th 2020.
[3] Detailed instructions are taken from the SSD1306.pdf acquired from
www.adafruit.com/datasheets/SSD1306.pdf.Illustrating images of C5515 eZDSP USB Stick
Development Tool are taken from http://www.ti.com.
[4] All source codes in this report are taken from the usbstk5515_v1 library associated with C5515
eZDSP USB Stick Development Tool, provided by Spectrum Digital Inc..