LCD Display Picaxe 08M2 and 28X2

veracruz290

New Member
Trying to use a serial enabled LCD with an 14M2 Picaxe, it works with the 28X2 why the difference? Any help would be greatly appreciated.
;This is the minimum amount of code that will enable the LCD-09395 to display "Warning Monday" if the picaxe is a 28X2. Great that works!!! ;However.... if I am trying to use a PICAXE 14M2 Micro-controller I get garbage on the screen.
;Any suggestions.
;Thanks, Rick
; Here are the equipments....
;https://www.sparkfun.com/products/9395 Serial Enabled 16x2 LCD - White on Black 5V LCD-09395 display functions given that the Picaxe is a 28X2.
;https://www.sparkfun.com/products/10802
; Code Below


main:
High B.4
Pause 3000
serout B.4,T9600_8,(254,1)
serout B.4,T9600_8,(0xFE,0x01,"Warning Monday ")
 

neiltechspec

Senior Member
Try

main:
setfreq m16
High B.4
Pause 3000
serout B.4,T9600_16,(254,1)
serout B.4,T9600_16,(0xFE,0x01,"Warning Monday ")

I have always found it is necessary to run @ 16mhz for reliable 9600 baud on m2 chips

Neil.
 

srnet

Senior Member
serout B.4,T9600_8,(254,1)
You are specifying the constant, T9600_8, for a baud of 9600 at a internal clock speed of 8Mhz.

The M2s have a default internal clock speed of 4Mhz, so you need to add a 'setfreq' command to adjust the internal clock to 8Mhz.
 

veracruz290

New Member
srnet, Thanks for your help, what I discovered with some trial and error. Initially in some other iterations of code I did have a setfreq command. Specifically setfreq 8, however the Picaxe m's seem to prefer setfreq m8. Again, I appreciate your help. Cheers, Rick
 

veracruz290

New Member
Try

main:
setfreq m16
High B.4
Pause 3000
serout B.4,T9600_16,(254,1)
serout B.4,T9600_16,(0xFE,0x01,"Warning Monday ")

I have always found it is necessary to run @ 16mhz for reliable 9600 baud on m2 chips

Neil.
Neil, This code does indee work well, Thanks for your assistance, Veracuz290
 
Top