|
|
View previous topic :: View next topic |
Author |
Message |
Guest
|
newbie question |
Posted: Wed Dec 22, 2004 10:26 am |
|
|
i am trying to flash an LED. using a PIC16f84a, the code works fine. but same code doesnt work for a PIC18f452???
Code: | #include <18F452.h>
#device adc=8
#use delay(clock=4000000)
#fuses NOWDT,WDT128,XT, NOPROTECT, NOOSCSEN, BROWNOUT, BORV20, NOPUT, STVREN, NODEBUG, LVP, NOWRT, NOWRTD, NOWRTB, NOWRTC, NOCPD, NOCPB, NOEBTR, NOEBTRB
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=9) |
Code: | void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
while (1) {
output_high(PIN_B4);
delay_ms(500);
output_low(PIN_B4);
delay_ms(500);
}
} |
what am I missing here? |
|
|
Guest
|
|
Posted: Wed Dec 22, 2004 10:53 am |
|
|
I forgot to tell you what is exactly the problem. the problem is that all the LED is not flashing, and is lit. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Dec 22, 2004 1:37 pm |
|
|
1. Change the "LVP" fuse to "NOLVP", unless you know for sure
that you're using a Low Voltage Programmer. 99% of users
do not use a LVP programmer, and so should set it to NOLVP.
2. Normally the RS232 is 8 bits. Is there a reason why you
have it set to 9 bits ? |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|