Hello,
I've been trying to get into the microcontroller world for some time now, but every time I make a new attempt, I miserably fail and quit for a month.
I'm currently on my fifth attempt, and probably well over my 100 hours of reading, coding, programming, re-checking code, re-checking circuitry, programming again,... But my circuits keep failing to work.
I'm trying to do the simple LED blinker, as sad as it sounds.
I run a 18F4220, programmed with a Kits R Us K150 programmer (I bought it built to ensure working condition).
The code is as follows. Ports in side B declared as all outputs, then a loop that turns them off, waits, turns them on, waits, and repeats itself. Clock set by INTOSCIO2, and set at 8MHz internal frequency.
But instead of blinking, I get absolutely no activity.
The layout is pretty easy. Power from VDD pin, ground from VSS. From any of the side B pins to a resistor, then to a LED, to ground.
Power is fed via a 5V 1A LM7805 regulator-based PSU.
I think it has to do with fuses not being properly programmed, or whatnot. Because the code cannot be simpler...
Any help will be widely appreciated
I've been trying to get into the microcontroller world for some time now, but every time I make a new attempt, I miserably fail and quit for a month.
I'm currently on my fifth attempt, and probably well over my 100 hours of reading, coding, programming, re-checking code, re-checking circuitry, programming again,... But my circuits keep failing to work.
I'm trying to do the simple LED blinker, as sad as it sounds.
I run a 18F4220, programmed with a Kits R Us K150 programmer (I bought it built to ensure working condition).
The code is as follows. Ports in side B declared as all outputs, then a loop that turns them off, waits, turns them on, waits, and repeats itself. Clock set by INTOSCIO2, and set at 8MHz internal frequency.
Rich (BB code):
#include <p18f4220.h>
#pragma config OSC = INTIO2
#pragma config FSCM = OFF
#pragma config WDT = OFF,DEBUG = OFF
void delay (void)
{
int i;
for (i = 0; i < 10000; i++);
}
void main(void)
{
OSCCON = 0x72;
TRISB = 0;
while(1)
{
PORTB = 0;
delay();
PORTB = 0x5A;
delay();
}
}
The layout is pretty easy. Power from VDD pin, ground from VSS. From any of the side B pins to a resistor, then to a LED, to ground.
Power is fed via a 5V 1A LM7805 regulator-based PSU.
I think it has to do with fuses not being properly programmed, or whatnot. Because the code cannot be simpler...
Any help will be widely appreciated
Last edited: