View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed May 23, 2007 2:15 pm |
|
|
Your program is too complicated for a test program. Try the program
shown below. Assuming that your PIC is running at +5v, this should work.
It will toggle an LED on pin B0. (The LED should have a series resistor.
Use a value from 220 to 470 ohms).
Code: |
#include <18F1220.h>
#fuses INTRC_IO, NOWDT, BROWNOUT, PUT, NOLVP
#use delay(clock=8000000)
void main()
{
while(1)
{
output_high(PIN_B0);
delay_ms(500);
output_low(PIN_B0);
delay_ms(500);
}
} |
|
|
|
jimcbride
Joined: 05 Apr 2006 Posts: 23
|
|
Posted: Wed May 23, 2007 2:28 pm |
|
|
This code also works and puts me at 7.95 MHz. I will poke through the fuses one ata time and see where the problem was. Is it possible to now use the 4x multiplier to get ~ 32MHz from the internal clock? |
|
|
Ttelmah Guest
|
|
Posted: Wed May 23, 2007 2:44 pm |
|
|
Not on this chip. Some others, do allow the PLL to be used with the internal oscillator (The 18F1330 for example), but on the 1220, the PLL is only available when using the external oscillator.
Best Wishes |
|
|
jimcbride
Joined: 05 Apr 2006 Posts: 23
|
|
Posted: Thu May 24, 2007 3:38 pm |
|
|
Thanks much for your help. I have found that the debugger will give me slightly different mcu speed reading when connected in different circuits. i.e. my demo board shows it runs at 8MHz, where my actual circuit shows 7.95 MHz. This explains some of my previous confusion. 18F1330 samples are on order, thanks for pointing that chip out. I like the idea of running at 32MHz with no xtal. Now if I can just get these 1-wire chips talking to each other I will be the hero... |
|
|
|