View previous topic :: View next topic |
Author |
Message |
pfuller
Joined: 14 Mar 2005 Posts: 4
|
Posted: Mon Mar 14, 2005 7:27 pm Post subject: Help! LCD Problem with Bascom / Atmega16 |
|
|
Hi,
I'm currently building an AVR app to output a simple "Hello"
on a 16x2 LCD, however I'm only getting black boxes on
the first line of the LCD no matter what I try. It works
fine on Atmel's AVRStudio, however I don't want to write
the application in Assembler. I want to purchase Bascom as soon
as this problem has been solved.
My configuration: 16x2 LCD in 4-Bit mode,
LCD is connected to Port C. PC0-PC3 = Data, PC4: RS, PC6: Enable
This is my code:
$regfile = "M16def.DAT"
$crystal = 4000000
Config Lcd = 16 * 2
Config Lcdbus = 4
Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 ,
Db7 = Portc.3 , E = Portc.6 , Rs = Portc.4
Cls
Lcd "Hallo"
End
I've also tried disabling fusebits for JTag - no success.
In addition I tried setting the params for the LCD via
the options menu - no success either. Also modifying Xtal
clock speed etc. didn't help. I think it must be
some sort of mistake since it works fine through AVRStudio.
Can someone point me in the right direction?
Thanks,
Peter |
|
Back to top |
|
|
Frankeman
Joined: 11 Aug 2004 Posts: 948 Location: the Netherlands
|
Posted: Mon Mar 14, 2005 9:12 pm Post subject: |
|
|
Hi,
Change the line "Config Lcdbus = 4" in "Config LcdMode = Port"
Frank. |
|
Back to top |
|
|
pfuller
Joined: 14 Mar 2005 Posts: 4
|
Posted: Mon Mar 14, 2005 9:31 pm Post subject: |
|
|
Thanks, but it still doesn't work
What else could be the problem? |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Tue Mar 15, 2005 9:49 am Post subject: Re: Help! LCD Problem with Bascom / Atmega16 |
|
|
pfuller wrote: | I think it must be some sort of mistake since it works fine through AVRStudio |
It works in AVRStudio, but with which HEX file?
The HEX file you use to program the chip in AVRStudio is basic
code compiled with Bascom AVR or is assembly code compiled
in AVRStudio?
See Bascom AVR help file topic "Newbie problems".
Luciano |
|
Back to top |
|
|
pedrodantas
Joined: 30 Dec 2004 Posts: 22
|
Posted: Tue Mar 15, 2005 1:05 pm Post subject: |
|
|
Hi,
Do you connect the Display R/W pin to 0V? It need to be connected to 0V...or else the LCD will stay in read mode.
Beste Regards,
Pedro Dantas |
|
Back to top |
|
|
naicheben
Joined: 18 Nov 2004 Posts: 47 Location: Leck
|
Posted: Thu Mar 17, 2005 8:46 am Post subject: |
|
|
I had the problem that the AVR was writing the commands and datas to the display while it still was initialising. Try a 'waitms 2000' before Cls and see if it works. |
|
Back to top |
|
|
|