|
|
View previous topic :: View next topic |
Author |
Message |
rudy
Joined: 27 Apr 2008 Posts: 167
|
18F4550 don't start, why? |
Posted: Sat Apr 03, 2010 3:19 pm |
|
|
Hi all,
I am changing one slave 16F877A for a new 18F4550. I tried everything to put the processor to start, but no deal, anybody can help me?
I use 20MHz crystal, and I need to run the chip as faster as possible. I don't use USB in my application.
Here are the fuses, I think the problem is here.
Code: |
#fuses HSPLL,USBDIV,PLL5,CPUDIV1,VREGEN,NOWDT,NOPROTECT,NOLVP,NODEBUG
#use delay(clock=48000000)
|
Best regards. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Apr 03, 2010 9:59 pm |
|
|
Quote: |
I use 20MHz crystal.
|
First try blinking an LED with the PIC running at 20 MHz, as shown in
the program below. Does this work ?
Code: |
#include <18F4550.h>
#fuses HS, NOWDT, PUT, BROWNOUT, NOLVP
#use delay(clock=20000000)
//====================================
void main()
{
// Blink an LED on pin B0.
while(1)
{
output_high(PIN_B0);
delay_ms(500);
output_low(PIN_B0);
delay_ms(500);
}
}
|
If that works, change the fuses to run in PLL mode:
Code: |
#include <18F4550.h>
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,USBDIV,PLL5,CPUDIV1
#use delay(clock=48000000)
//==========================
void main()
{
while(1)
{
output_high(PIN_B0);
delay_ms(500);
output_low(PIN_B0);
delay_ms(500);
}
} |
|
|
|
rudy
Joined: 27 Apr 2008 Posts: 167
|
|
Posted: Sun Apr 04, 2010 5:59 am |
|
|
Yes, the problem was the port address, I was calling 0x80 but, in 18F4550 is 0xf80.
works fine now,
regards. |
|
|
|
|
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
|