View Full Version : lcdout wont work with a 18f4610
Bonxy
- 27th December 2004, 00:47
Hi all
the folowing one line "lcdout" command works with any other pic
i program but it won't work with a 18f4610, WHY ?
All input apreciated.
---------------
Bri
DEFINE LCD_DREG PORTD
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTE
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTE
DEFINE LCD_EBIT 1
DEFINE OSC 8
ADCON1 = 7
Pause 1000
Main:
LCDOut $fe,1,"hello"
Stop
End
mister_e
- 27th December 2004, 01:36
Try ADCON1=$0F
case not working
Are you using PICSTART ??? Are you able to BLANK PIC and check for BLANK ALL ???
Is anything else work with...like LED Blink...
Did you set config fuse to HS OSC??
Is those define do something better
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
case else try increase to previous to higher values...
Bonxy
- 27th December 2004, 11:26
Hi mister_e
I tried changing "ADCON1 = 7" to "ADCON1 = $0f" and it works !!!
:-)
Thanks
---------------
Bri
Ps: if you have time you could tell me what the diffrence is between the two commands.
mister_e
- 27th December 2004, 16:36
Hi Bri,
Great to know everything is working fine for you now !
Since every PIC can be different, refer to datasheet for ADCON1 setting of your PIC18F4610.
Open your datasheet or PDF http://ww1.microchip.com/downloads/en/DeviceDoc/39636a.pdf
at the REGISTER 18-2 ADCON1 (pdf page 214)
to get all pin to digital you must set ADCON1 to $0F, 15, or %00001111.
if you're setting ADCON1=7, you will get only AN<12:8> to digital, the rest to analog.
that's it, that's all, basketball!!!
Bonxy
- 28th December 2004, 15:29
Hi Steve
Thanks for explaining it to me, this 18f4610 seems realy dificult to get things to work compaired with the other pic's i have used.
before i put my question on here i thought that the problem might be the port pins not being set to digital/output so i wrote "trisd = 0" and "trise = 0" but that did not help.
I thought that the "trisx = 0" made the port an output ?
anyway, it works now.
Thanks again
-------------
Bri
Powered by vBulletin® Version 4.1.7 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.