void PIC_setting(void){
ADRESH = 0x00;
ADRESL = 0x00;
ADCON0 = 0x44;
ADCON1 = 0x06;
TRISA = 0x00;
TRISB = 0x00;
TRISC = 0x00;
TRISD = 0x00;
TRISE = 0x00;
}
void main() {
PIC_setting();
while (1){
PORTA = 0x01;
delay_ms(1000);
PORTA = 0x00;
delay_ms(100);
}
}
It dosent have an internal oscillator and how will i disable the MCLR pin? via program or hardware? if in program than how in hardware. i have a resistor of 220 ohm on board may be i missed it here...I can not see anything from your picture it is way to fuzzy. First for testing only. Use internal oscillator and disable the MCLR pin. Do this in the config settings. Then check your data sheet. And apply power/GND to all the pins used for this purpose. And your LED need a series resistor. Do not connect a LED directly to MCU port ever. I would say a resistor in range about 300 ohm. Should do fine
Forget it. My bad. Since it was a 18F chip I was quite sure it has those functions. But your chip was introduced before these functions become standardIt dosent have an internal oscillator and how will i disable the MCLR pin? via program or hardware? if in program than how in hardware. i have a resistor of 220 ohm on board may be i missed it here...
Thanks
void PIC_setting(void){
ADRESH = 0x00;
ADRESL = 0x00;
ADCON0 = 0xC5;
ADCON1 = 0xCE;
TRISA = 0x00;
TRISB = 0x00;
TRISD = 0x00;
TRISE = 0x00;
UART1_init(9600);
}
char read;
void main() {
PIC_setting();
delay_ms(100);
while (1){
PORTA = ~PORTA;
UART1_write_text("U%");
delay_ms(500);
UART1_write_text("U%");
delay_ms(500);
UART1_write_text("L%");
delay_ms(500);
UART1_write_text("L%");
delay_ms(500);
UART1_write_text("D%");
delay_ms(500);
UART1_write_text("D%");
delay_ms(500);
UART1_write_text("R%");
delay_ms(500);
UART1_write_text("R%");
delay_ms(500);
}
}
by Aaron Carman