Hello Group,
Has anyone had difficulties with LCD's not displaying anything with ATmega 32m1 or 16m1. I have tried both and don't see what I'm missing and could use some help. Using almost the exact code on ATmega328P works fine. Both 16x2 and 20x4 displays are not working with the m32m1 or m16m1. Any suggestions would be very appreciated.
Regards Larry
[code:1:d1ae83526a] '------------------------------------------------------------------
' LCD_test_m32m1_LA-1.bas
'
' Using this program for testing LCD
'
'
'
'------------------------------------------------------------------
' Flash 3%
' ==============================================================================
' Connect the R/W line of the LCD to GND.
' Use the 4 x 20 display and Back Lite 15 is ground and 16 on LCD is Positive use about 4.2 volts
$regfile = "m32m1.dat"
$crystal = 16000000
Dim B As Byte
'open channel for output
Open "comc.1:38400,8,n,1" For Output As #1 ' pin 3
Print #1 , " LCD_test_m32m1_LA-1.bas "
Config Portb.2 = Output ' LED Green Pin 16 (was 25 C.7)
Config Lcd = 20 * 4
Config Lcdpin = Pin , Db4 = Portc.7 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , E = Portb.4 , Rs = Portb.3
' Remarked line below also tried without success.
' Config Lcdpin = Pin , Db4 = Portb.0 , Db5 = Portb.1 , Db6 = Portb.2 , Db7 = Portb.3 , E = Portd.6 , Rs = Portd.5
Config Lcdmode = Port
Cls
Do
Incr B
Print #1 , " Hello " ; B
Locate 1 , 1
Lcd " Hello " ; B
Locate 2 , 1
Lcd " LCD test line 2 "
Locate 3 , 1
Lcd " m32m1 ATmega32m1 "
Locate 4 , 1
Lcd "Apr/28/13 Line--4X20"
Portb.2 = 1 ' green led on
Wait 2
Portb.2 = 0 ' green led off
Loop[/code:1:d1ae83526a]
[b:d1ae83526a][color=red:d1ae83526a](BASCOM-AVR version : 2.0.7.6 )[/b:d1ae83526a][/color:d1ae83526a]
↧