Click here to Skip to main content
Licence CPOL
First Posted 27 Feb 2009
Views 23,430
Downloads 764
Bookmarked 51 times

LCD with USB Toolstick c8051

By | 22 Mar 2009 | Article
LCD with USB Toolstick c8051

Introduction

This is a LCD (MC20E2D-SYL) 8-bit 2x20 LCD module with Silabs 'toolstick dauther (F330)' updated with new firmware (in 'timer.zip' - LCD controller) and 'debug adapter(F321)' (also known as 'toolstick EK') made unit.

IMG005s.JPG

Prototype

usbio.JPG

With that, you can send text to display connected through USB debug adapter.

Prototype board:
To use 'usbhidio' you must update firmware for 'debug adapter'.
Toolstick --really is named 'Debug adapter' firmware in download section at the top
(to update use 'toolstick base adapter').
On desktop, run usbhidio2.exe (VB6) and type text on screen. Make sure that baud is 9600 and you are ready.

Software can be modified and run independently by supplying power.
Connections are seen on this page: http://www.8051projects.net/lcd-interfacing/introduction.php.

lcdpins.jpg

I made it like this:

<------------------ 'Toolstick F330'-----------------> <---Display--->
P1.0 to P1.7 P0.6 P0.7 P0.4(TX) P0.5(RX) VDD(3V) GRD&RW 5V
^ ^ ^ ^ ? ^ ^ ^ ^
DB0 to DB7 EN RS RX(25) TX(26) PIN6 GRD USB

<--------Display-------> <------------- 'Debug adapter F321'------------>

To adjust background, replace resistor 1,5K between GRD and VEE(PIN3) on LCD.
Also on LCD input RW(PIN5) is tied to GRD.
See the image below for connections:

Click to enlarge image

This is a very small and accurate job - thus that can't solder- don't bother to.

Background

Take a look at the previous article Counter based c8051 and this CodeProject article LCD with parallel port.
Take a look at the next article USB IR with c8051.

Using the Code

On desktop application, just press enter on textbox to display data on LCD - For those that are interested in the code - here is the main routine:

void main (void)
{
    uchar i;
    uchar j;
    uchar dummy;
    PCA0MD &= ~0x40; 		// Clear watchdog timer enable
    Timer0_Init (); 		// Initialize the Timer0
    Port_Init (); 			// Init Ports
    //SYSCLK_Init (); 		// Initialize Oscillator
    UART0_Init();
    EA = TRUE; 			// Enable global interrupts
    LED=0;
    LCD_RS = 0;
    LCD_RW = 0;
    TimerStart( SYS_TIMER, 500 ); 	// wait for display to wake up
    while( !TimerReady( SYS_TIMER ));
    LCD_init();
    LCD_Home();
    LCD_sendstring("Start");
    /*
    move_to_specific(2, 1);
    LCD_sendstring("LCD second string");
    TimerStart( SYS_TIMER, 1000 ); 	// wait for display to wake up
    while( !TimerReady( SYS_TIMER ));
    LCD_Home();
    LCD_sendstring("UART");
    */
    while(1)
    {
        if(TX_Ready == 1 && UART_Buffer_Size != 0 && Byte == 13)
        {
            LCD_Clear();
            j=0;
           //--------------
           for(i = 0; i < (UART_Buffer_Size - 1); i++ ){ // Initialize software timers.
               if(j>19)
               {    //line full 
                    move_to_specific(2, 1);
                    j -= 20; } LCD_senddata(UART_Buffer[i]); j++;
               }
               //--------------
               TX_Ready = 0; 	// Set the flag to zero
               TI0 = 1; 		// Set transmit flag to 1
         }
    } 				// Loop forever
} 

Points of Interest

There are a lot of samples on the internet, but it is hard to find an article about displaying text through USB and using 8-bit LCD like MC20E2D-SYL.

History

  • 27th February, 2009: Initial post
  • 19th March, 2009: Article updated

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

ingvar8



Estonia Estonia

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Generalcomments PinmemberShane Story7:42 2 Mar '09  
GeneralRe: comments PinmemberMarkbanang2:45 23 Mar '09  
GeneralRe: comments PinmemberShane Story2:49 23 Mar '09  
GeneralRe: comments PinmemberShane Story2:51 23 Mar '09  
GeneralRe: comments PinmemberRick York11:38 24 Mar '09  
Generalinteresting PinmvpLuc Pattyn9:53 27 Feb '09  
GeneralRe: interesting Pinmemberingvar822:27 1 Mar '09  
GeneralRe: interesting Pinmemberingvar823:05 1 Mar '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 22 Mar 2009
Article Copyright 2009 by ingvar8
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid