CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

New SBC44B and simple blinking LED HELP
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Tim Moody



Joined: 30 Sep 2005
Posts: 17

View user's profile Send private message

PostPosted: Thu Oct 20, 2005 4:20 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Oct 20, 2005 4:41 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Oct 20, 2005 8:21 pm     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Oct 20, 2005 9:03 pm     Reply with quote

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








PostPosted: Fri Oct 21, 2005 8:32 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 21, 2005 9:56 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Oct 21, 2005 10:14 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 21, 2005 10:24 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 21, 2005 11:22 am     Reply with quote

From within the IDE click on View/Valid Fuses.

They are all discribed somewhat.
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Fri Oct 21, 2005 11:27 am     Reply with quote

Some more information in the datasheet that you may have missed:

Tim Moody



Joined: 30 Sep 2005
Posts: 17

View user's profile Send private message

PostPosted: Fri Oct 21, 2005 1:12 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Oct 21, 2005 1:27 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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