Saturday 21 April 2012

VSM and the AXE033 display


My first test of the VSM simulator didn't go well - I tried to output a simple text message from a 20x2 to an AXE033 LCD component, and nothing happened.


For once, a quick Google sent me in nearly the right direction, and a bit of trial and error got it sorted soon afterwards


Key points:

  • Despite a 2008 promise on the Forum to provide improvements, the VSM will still (in 2012) only write to the AXE033 at T2400 (or T2400_8 if frequency is at m8, eg 20x2)
  • If you are writing to the AXE033 as the first thing your program does, you may need to add a delay: in my case 150 milliseconds is enough: a bit less gets you part of the string, and no pause results in no string!
Here is a program to run on a 20x2 with an AXE033 connected to pin C.0:




'test program to get 033 LCD working 
#define forVSM




#ifdef forVSM
symbol baudRate=T2400_8 'for VSM
#else
symbol baudRate=N2400_8 'for physical chip
#endif


symbol pinForDisplay=C.0




#ifdef forVSM

#rem
VSM needs 150 milliseconds (in my configuration) before it can write to the LCD/OLED. 
This is only needed if writing at the very start of the program, 
so if your LCD/OLED write happens at least 150 msecs after program starts
then you won't need this
You can try a shorter pause (eg 120) - in my case I only got the end of the string displayed


#endrem
pause 150
#endif


serout pinForDisplay,baudRate,(254,1) 'clear screen
pause 30 'give screen clear time to execute


serout pinForDisplay,baudRate,(254,128) 'go to start of line 1
serout pinForDisplay,baudRate,("0123456789abcdef")


serout pinForDisplay,baudRate,(254,192) 'go to start of line 2
serout pinForDisplay,baudRate,("fedcba9876543210")

No comments:

Post a Comment