Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Powertip PC1602F B running 4Bit Mode Bascom ?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
autoguider

Bascom Member



Joined: 24 Sep 2007
Posts: 82
Location: Aachen

germany.gif
PostPosted: Sun Mar 23, 2014 8:52 pm    Post subject: Powertip PC1602F B running 4Bit Mode Bascom ? Reply with quote

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
View user's profile
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Sun Mar 23, 2014 11:51 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website MSN Messenger
autoguider

Bascom Member



Joined: 24 Sep 2007
Posts: 82
Location: Aachen

germany.gif
PostPosted: Mon Mar 24, 2014 12:38 am    Post subject: Reply with quote

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
View user's profile
autoguider

Bascom Member



Joined: 24 Sep 2007
Posts: 82
Location: Aachen

germany.gif
PostPosted: Tue Apr 15, 2014 10:57 am    Post subject: Reply with quote

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
View user's profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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