Colin Mac
Newbie level 4
I'm used to programming 8051s but got a couple of PICs and a programmer.
I spent the last few days learning pic asm for 16F but when I went to program my chip I found a problem with the device. I have a 18F2520 which works in the programmer. My question is, does anyone have code for blinking a led using
a 18F2520? I don't mind if it's C, asm or basic. I'm just anxious to test my programmer and can't find code on the internet.
I've tried this, but it didn't work.
Added after 3 hours 7 minutes:
It's ok. I've figured it out.
I spent the last few days learning pic asm for 16F but when I went to program my chip I found a problem with the device. I have a 18F2520 which works in the programmer. My question is, does anyone have code for blinking a led using
a 18F2520? I don't mind if it's C, asm or basic. I'm just anxious to test my programmer and can't find code on the internet.
I've tried this, but it didn't work.
Code:
Device = 18F2520
Clock = 8
Config OSC = INTIO67 // Use the Internal Oscillator
Include "utils.bas"
Dim LED As PORTA.0 // Assign an alias for "LED"
// Start Of Program...
OSCCON = %01111111 // Sets up the internal oscillator
SetAllDigital // Make all Pins digital I/O's
Low(LED) // Make the LED pin an output and set it low
While True
LED = 1 // Turn on the LED
DelayMS(500) // Delay for half a second
LED = 0 // Turn off the LED
DelayMS(500) // Delay for half a second
Wend
Added after 3 hours 7 minutes:
It's ok. I've figured it out.