AtomSoft
Well-Known Member
I wrote this simple code
Yet it doesnt work right. Im worried it might give me a issue later on. What it does it light led 1 on RA1 then led 2 on RA2 but once it lights led 2 LED 1 turns off.
How come?
Code:
#include <system.h>
#pragma DATA _CONFIG1H, _INTIO1_OSC_1H
#pragma DATA _CONFIG2L, _BOR_OFF_2L
#pragma DATA _CONFIG2H, _WDT_OFF_2H
#pragma DATA _CONFIG4L, _LVP_OFF_4L
#pragma CLOCK_FREQ 8000000
void main(void)
{
set_bit( osccon, IRCF2 ); //8 MHz
set_bit( osccon, IRCF1);
set_bit( osccon, IRCF0 );
trisb=0;
trisa=0;
porta=0;
portb=0;
porta.1=1;
delay_s(2);
porta.2=1;
while(1){
}
}
Yet it doesnt work right. Im worried it might give me a issue later on. What it does it light led 1 on RA1 then led 2 on RA2 but once it lights led 2 LED 1 turns off.
How come?