Re: Getting 18F458 to blink
Try adding CMCON=7 to your code to disable the comparator
EDIT: ADCON1=6 would be all digital, ADCON1=15 makes AN0 analog with AN3 VREF+ and AN2 VREF-
Re: Getting 18F458 to blink
And you can remove LOW LED at the bottom. Toggle will change the state for you; if it was ON, it will turn OFF, and vice versa.
Do you really need the watchdog timer?
Can you put the CONFIG statement in the include like that?
(never saw that before, usually it's at the top of your program, but I don't use MPLAB).
Robert
Re: Getting 18F458 to blink
It may be working just perfect. In your loop the first thing you do is toggle the led. Then you pause for half a second. Then you set the output low and instantly go back to the top of the loop, where you will toggle again turning on the led. As was suggested, remove the low led command. Or you could add another pause after it so you will have time to see it go low.
Re: Getting 18F458 to blink
All three of you where right. Thank you all. Deleted the "LED low" command (wich I added after nothing happened). Added "CMCON = 7" as Shawn suggested. Now it works. Grrrmmm three lousy bits, many days no sleep...
@Demon: Both ways work. But if the CONFIG is in the include file, it mustn't be in the program and vice versa.
Re: Getting 18F458 to blink
Quote:
Originally Posted by
Demon
Can you put the CONFIG statement in the include like that?
(never saw that before, usually it's at the top of your program, but I don't use MPLAB).
Until PBP 3 that is the default way, configs in the *.inc
MPLAB has nothing to do with it.