View previous topic :: View next topic |
Author |
Message |
Sebastian.Heyn
Joined: 13 Apr 2005 Posts: 86
|
Posted: Sat May 09, 2015 8:51 pm Post subject: [closed] Pollin LCD 20*4 SPLC780D1 |
|
|
Hi,
did anyone have any luck getting the LCD to work with BASCOM??
http://www.pollin.de/shop/dt/MjEzOTc4OTk-/Bauelemente_Bauteile/Aktive_Bauelemente/Displays/LCD_Modul_TC2004A_01T.html
I checked all the connections, and the code/pcb has previously been used with a 20*04 by another supplier (Ks077)
I have tried various startup timings and also with/without the chipset=ks077
The contrast interface works, as I can see the two black bars becomming darker slowly
Code: |
$regfile = "m32def.dat"
$crystal = 16000000
$swstack = 96
$hwstack = 64
$framesize = 96
'############## LCD Stuff
Dim Bright As Byte
Dim Contrast As Byte
Config Timer1 = Pwm , Prescale = 8 , Compare A Pwm = Clear Up , Compare B Pwm = Clear Down
Config Portc = Output ' lcd
Config Portd.4 = Output
Config Portd.5 = Output
Config Lcd = 20 * 4, chipset= Ks077
Config Lcdbus = 4
Config Lcdpin = Pin , Db4 = Portc.6 , Db5 = Portc.5 , Db6 = Portc.7 , Db7 = Porta.7 , E = Portc.4 , Rs = Portc.3
Dim Si As Byte
Enable Interrupts
Disable Int0
Disable Int1
Disable Int2
'####### Initialize everything
Contrast = 20
Bright=128
Waitms 1500
cls
waitms 100
Initlcd
Waitms 500
Cursor Off
cls
Waitms 500
Start Timer1
ocr1a = contrast
Ocr1b = Bright
Do
'contrast setting loop
for si= 1 to 255
ocr1a=si
locate 1,1
lcd si
locate 2,1
lcd si
locate 3,1
lcd si
locate 4,1
lcd si
waitms 100
next
loop
end
|
(BASCOM-AVR version : 2.0.7.8 )
Last edited by Sebastian.Heyn on Sat May 09, 2015 9:44 pm; edited 1 time in total |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat May 09, 2015 9:11 pm Post subject: |
|
|
when you write Quote: | I checked all the connections, and the code/pcb has previously been used with a 20*04 by another supplier (Ks077) |
you mean you tested THIS pcb with the working ks077 LCD, right?
Or is this a copy of the board? I ask because of the JTAG that could be a problem.
So best to check the fuse bits first for JTAG.
The display itself seems a standard one. Nothing special. The , chipset= Ks077 is not required. Config Lcdbus = 4 is not needed either since you use pinmode. _________________ Mark |
|
Back to top |
|
|
Sebastian.Heyn
Joined: 13 Apr 2005 Posts: 86
|
Posted: Sat May 09, 2015 9:37 pm Post subject: |
|
|
Ok,
I checked the fuses (again, this has cost me 2 working days with another project before )
I wonder, as I cannot get any further than the two (l1+l3) black lines, which usually means initialisation wrong, correct??
No. THIS PCB was not tested using another display. Layout is same however. - I checked each pin on the display itself using my scope to see if I had any bad connection or something |
|
Back to top |
|
|
Sebastian.Heyn
Joined: 13 Apr 2005 Posts: 86
|
Posted: Sat May 09, 2015 9:43 pm Post subject: |
|
|
Hi Albert,
you're my hero. I rechecked the pcb under the microscope.
It works now after removing some flux |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat May 09, 2015 9:48 pm Post subject: |
|
|
if this pcb is not known to be good, i advise to connect it to the known good lcd. you could also connect this new lcd to a working pcb. you then know if the problem is in the lcd or the board/soft.
usually i check all connections one by one with a simple pin that i let toggle ;
do
toggle portc.6 'measure with scope
waitms 500
loop
this is simple but effective. I have pulled out hairs with the STK200 because for some chips the connections are not what you expect. but this simple test procedure solves this.
sometimes a simple ohm meter is ok too ; measure connections one by one. sometimes you get blind when busy for too long. _________________ Mark |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat May 09, 2015 10:01 pm Post subject: |
|
|
i see my post crossed yours. but i leave it there for others. these are common problems.
great that you found it. yes flux can be a problem. heard about that before. use 'noclean' type when possible. not an option for production but nice @home. _________________ Mark |
|
Back to top |
|
|
|