View previous topic :: View next topic |
Author |
Message |
Tim Moody
Joined: 30 Sep 2005 Posts: 17
|
|
Posted: Thu Oct 20, 2005 4:20 pm |
|
|
Hum,
Got it and I think it is the fuse directive, but I have not confirmed that. I also need to play around with timing a little as I am getting a 12Hz pulse coming out. It should be 2Hz.
Tim |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Oct 20, 2005 4:41 pm |
|
|
That's why I asked you to confirm what the frequency of the crystal
is that's actually installed in the board, because it's an option that you
must select when you order the board on their webpage. |
|
|
Tim Moody
Joined: 30 Sep 2005 Posts: 17
|
|
Posted: Thu Oct 20, 2005 8:21 pm |
|
|
PCM,
Actually I did that, I just forgot to mention it. It is a 20Mhz oscillator so I felt the delay directive was correct. I played with the code a little and duplicated the delay and I still have a 12Hz pulse on B0. I am still doing something a little wrong, but I'll get there.
Thanks
Tim |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Thu Oct 20, 2005 9:03 pm |
|
|
Tim Moody wrote: | Hum,
Got it and I think it is the fuse directive, but I have not confirmed that. I also need to play around with timing a little as I am getting a 12Hz pulse coming out. It should be 2Hz.
Tim |
If you are using the most recent code example from this thread it should be 1Hz. 500ms off, 500ms on.
Are you sure it is 12Hz? Not 6Hz or possibly 4Hz? How did you measure it?
The 458 includes a 4 x PLL and I am curious if this is active. The PLL only gets reset when the PIC is power cycled so it is a constant source of confusion and head scratching. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Guest
|
|
Posted: Fri Oct 21, 2005 8:32 am |
|
|
I measured it with a Tek TDS320. It is on for 16.5mS and off for 66mS. I also changed the code and added more delay statements to extend the delay but the output never changed, still 12Hz.
Tim |
|
|
Tim Moody
Joined: 30 Sep 2005 Posts: 17
|
|
Posted: Fri Oct 21, 2005 9:56 am |
|
|
Got it..................
Just FYI. I have been playing around with a few things and noticed something. First I changed to RA0 then RA1 and still saw the same 12Hz pulse on these ports. Then I changed my delay to 1mS and noticed the 12Hz pulses changed. I looked a little closer and noticed that each of the pulses were actually seven 1mS pulses. So what is happening is the code is working, but somehow the port is getting shut off after 16.5mS. This got me thinking about fundamentals. I moved the scope probe over to the VReg pin and almost puked. It was 7Vpp of 60Hz ripple. So at 60Hz, every 16.5mS there was enough voltage present. It may have been resetting, I did not look.
Thanks for all your help.
Tim Moody
PS I still want to find more info on the fuses. I looked at the data sheet, but it does not really say(of course) what the compiler is doing, and the compiler docs are slim on them |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Fri Oct 21, 2005 10:14 am |
|
|
Tim Moody wrote: |
PS I still want to find more info on the fuses. I looked at the data sheet, but it does not really say(of course) what the compiler is doing, and the compiler docs are slim on them |
In the datasheet the fuses are in the section "Special Features of the CPU" You can find the labels used by CCS in the specific header file for the processor such as 18F458.H _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Tim Moody
Joined: 30 Sep 2005 Posts: 17
|
|
Posted: Fri Oct 21, 2005 10:24 am |
|
|
asmallri,
Thanks, and I got all that. It still isn't real clear what they are. Take HS XT RC or LP, the data sheet for the 458 says they are oscillators. The header file says it's a fuse. So it's a fuse setting for an oscillator, but I cannot find the information that tells me what they mean. Is HS high Speed, meaning a 20Mhz or greater oscillator?? Without knowing that, how do I know which oscillator fuse to set. The header file for the 18F458 have 5 million fuses in there. What do they all mean?? I'd like to understand this device a little more. I am learning, but a little too slowly for my tastes.
Tim Moody
PS I look at the fuses as registers. Is that correct?? |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
|
Posted: Fri Oct 21, 2005 11:22 am |
|
|
From within the IDE click on View/Valid Fuses.
They are all discribed somewhat. |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Fri Oct 21, 2005 11:27 am |
|
|
Some more information in the datasheet that you may have missed:
|
|
|
Tim Moody
Joined: 30 Sep 2005 Posts: 17
|
|
Posted: Fri Oct 21, 2005 1:12 pm |
|
|
Neutone,
I am using MPLAB 7.2 with ICD2 and a 18F458. Valid Fuses is not part of the View dropdown. They are:
1.Disassembly Listing
2.Hardware Stack
3.Program Memory
4.File Registers
5.EEPROM
6.Memory Usage Gauge
7.LCD Pixel(greyed out)
8.Watch
9.Call Stack(greyed out)
10.Special Function Registers
jecottrell
I did miss that, thanks. I guess I just have to keep digging.
Tim Moody |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Oct 21, 2005 1:27 pm |
|
|
You don't get it with MPLAB. You only get it with PCW (or PCWH) help.
There are two parallel development systems. One uses mostly
Microchip products, but integrates the CCS command line compiler(s).
The other uses CCS products only. I use #1, Neutone uses #2.
1. MPLAB and ICD2, with the PCM, PCH or PCB command line compilers.
2. The PCW (or PCWH) IDE and ICDU-40, etc. |
|
|
|