View previous topic :: View next topic |
Author |
Message |
autoguider
Joined: 24 Sep 2007 Posts: 82 Location: Aachen
|
Posted: Sun Mar 23, 2014 8:52 pm Post subject: Powertip PC1602F B running 4Bit Mode Bascom ? |
|
|
Dear All,
I am trying to get now my 2nd Powertip PC1602F B Display operating in 4 Bit mode on a AVR 168 Mega@ 6 MHz ( Fuse Bits are checked)
Sometimes I get some correct data displayed. But then the display seems to be frozen or it does not show anything.
I am using the compiler version 2.0.7.6
Here my config data
Config Lcd = 16*2
Config LCDBUS = 4
Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portd.4 , Db6 = Portd.7 , Db7 = Portb.0 , E = Portd.3 , Rs = Portd.2
initlcd
Does someone have this display in successful operation with BASCOM ?
What library do I have to include ?
The funny thing is that it works sometimes and then it got stuck. It seems that some wait statements within the bascom code cause some trouble.
The cable connections are doublechecked more than 4 times.
Imalso tried the second display and it shows the same strage behaviour as the first one.
So I think that there may be some incompatibility with the displays chipset.
Even there I could not find clear information in the net.
Please let me know about your experience.
best regards
Christian
(BASCOM-AVR version : 2.0.7.6 , Latest : 2.0.7.7 ) |
|
Back to top |
|
|
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
Posted: Sun Mar 23, 2014 11:51 pm Post subject: |
|
|
did you test it without the Config LCDBUS = 4 & initlcd ?
try :
Code: | Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portd.4 , Db6 = Portd.7 , Db7 = Portb.0 , E = Portd.3 , Rs = Portd.2
Config Lcd = 16 * 2
Waitms 500 |
_________________ / Kim |
|
Back to top |
|
|
autoguider
Joined: 24 Sep 2007 Posts: 82 Location: Aachen
|
Posted: Mon Mar 24, 2014 12:38 am Post subject: |
|
|
Daer Kim,
many thanks for your advice.
I tried your code.
I found out that the lcdinit is essential.
If I do not use it there is nothing displayed.
Whre I leave it the then I get the correct text in the upper line of the display.
I have the feeling that there is also some text written into the lower line but then the display is put into a mode so that nothing is readable.
Next funny thing:
lcd "Init Started"
locate 2,1
.
further code ..
lcd "asddsa"
locate 1,1
If I do not use the locate 1,1 statement the display looks empty.
It seems that each lcd command has to be followed by a locate command.
I cannot imagine that this is the correct way. Maybe it is a workaround.
best regards
Christian |
|
Back to top |
|
|
autoguider
Joined: 24 Sep 2007 Posts: 82 Location: Aachen
|
Posted: Tue Apr 15, 2014 10:57 am Post subject: |
|
|
Dear all,
I changed to the lcd4busy_anypin.lbx library.
So I invested 1 additional pin at the cpu.
Most Important is to set the WR-pin to 0 before executing the initlcd procedure !
This is the code snippet:
$lib "lcd4busy_anypin.lbx"
$lib "mcs.lbx"
$regfile = "m168def.dat" ' specify the used micro
$crystal = 6000000 ' used crystal frequency
$hwstack = 90
Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portd.4 , Db6 = Portd.7 , Db7 = Portb.0 , E = Portd.3 , Rs = Portd.2 , WR = PortD.5, BUSY= Portb.0
PortD.5=0 ' WR -pin set to 0 before initialisation of display
initlcd
.
.
.
Now it works fine.
best regards
Christian |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|