PDA

View Full Version : PIC18f452 blinking led ?



iugmoh
- 5th March 2008, 07:25
Hi all,
Anyone have code and suggestions to begin with PIC18F452 , for simplest case blinking led I will use 4MHZ XT crystal

paul borgmeier
- 5th March 2008, 08:12
how about



Main:
toggle portb.0
pause 500
GOTO Main
END

give it a try and reply if you need more

iugmoh
- 5th March 2008, 12:24
Oky I try this part of code , but nothing is working , always off , I think there is aproblem is defining the oscillator

skimask
- 5th March 2008, 14:06
Oky I try this part of code , but nothing is working , always off , I think there is aproblem is defining the oscillator

Ya know, we can already read the other thread concerning this issue...

iugmoh
- 7th March 2008, 11:33
Oky It's working now with the same code without any changing , I think the problem is that the chip which is not working with code is damaged , I replace it and everything is working now

define osc 4

trisb=0

main:
portb=0
pause 1000

portb=255
pause 1000

goto main

end

skimask
- 7th March 2008, 14:12
Note: Put all your DEFINE's in all CAPS. I make it a habit of putting the complete DEFINE in all CAPs. That way there's no question in my mind later on.

As far as the chip dying....Ya...you'll have that... Probably happened to every one of us once or twice...scratch our heads for days on end...asked a millions questions...questioned our own abilities (or lack thereof)...only to find out that the core of the problem is the core of the problem...
Go figure...