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

Internal RTC in PIC18F46J50

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Renju1988



Joined: 13 May 2015
Posts: 5

View user's profile Send private message

Internal RTC in PIC18F46J50
PostPosted: Wed May 13, 2015 12:32 pm     Reply with quote

Hi,
I am Renjith. I am working on PIC18f46j50. I have implemented internal RTC, and my program is getting worked fine, i have configured RTC to work with external clock of timer1. I have provided external timer1 clock with 32.768Khz crystal with 12pf capacitor grounded. My problem is, when I am checking the time is running littile faster, for 1 day I am getting an additional 4 minutes.
I need to know whether i should select any particular crystal oscillator. What about oscillator ppm, also about capacitor value. I have read that if values of capacitor changed time may also vary.
Please help me......
Ttelmah



Joined: 11 Mar 2010
Posts: 19477

View user's profile Send private message

PostPosted: Wed May 13, 2015 1:48 pm     Reply with quote

First look at AN1288 from Microchip. Also AN588.

Your problem could be crystal selection, capacitor value, or pickup from another signal.

If your crystal is meant to require 12pF load capacitance, you don't want 12pF capacitors. The crystal sees as it's load capacitance, the capacitance of the track to one pin, paralleled to the pin capacitance, paralleled with the capacitor on this pin, _in series_ with the same set of capacitances on the other pin.

Typical pin capacitances and track capacitances will sum to perhaps 7pF total (depends massively on your board layout...). So your crystal would 'see' 7pF+12pF in series with the same again. About 9.5pF.

Also, you need to look at what the quoted accuracy of your crystal is. Cheap ones may only give a few seconds a day _at best_. Accuracy costs money.
Renju1988



Joined: 13 May 2015
Posts: 5

View user's profile Send private message

PostPosted: Wed May 13, 2015 10:43 pm     Reply with quote

Thank you Ttelmah,
I will go through the application notes, thank you once again.
Renju1988



Joined: 13 May 2015
Posts: 5

View user's profile Send private message

USB Bootloader
PostPosted: Fri May 15, 2015 1:44 am     Reply with quote

I am using the USB bootloader which comes with ccsc compiler. I have edited it for my PIC18f46j50. i have got it worked and i uploaded an application program using siow. But one major problem is my bootloader size is taking only 10% ROM, but it is taking almost 45%of RAM.
Is it like that. or is my program error.
Because of bootloader taking this much RAM, my main appilication program with oled display is not not working, but when i uploaded a small program, its worked fine. Main application program is working when i uploaded it with a programmer.
Is there any way to reduce the bootloader RAM consumption. i am using ex_usb_bootloader program as bootloader.
Please help me.
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

Re: USB Bootloader
PostPosted: Fri May 15, 2015 1:56 am     Reply with quote

It doesn't matter how much RAM the bootloader uses. The main application code and the bootloader run independently and the main code will reuse any RAM the bootloader uses, just as it reuses any peripherals. Bootloaders are likely to use a lot of RAM as they have to buffer large chunks of code. This limits their usefulness on PICs with very limited RAM, regardless of the size of ROM/program memory.

One thing to remember though, is that if the main code has just been bootloaded, the contents of any RAM that it doesn't initialise will be whatever the bootloader left in there. It's never good to rely on uninitialised RAM having a particular content - maybe 0x00 or 0xFF - but with bootloaders and any other warm start situation (where the PIC has been restarted after having run) its especially troublesome.

Of course, the bootloader and main code must be in program memory (ROM) at the same time, so it does matter how big the bootloader code is.
Renju1988



Joined: 13 May 2015
Posts: 5

View user's profile Send private message

PostPosted: Tue May 19, 2015 2:33 am     Reply with quote

I have got the boot-loader working fine. But my program was getting slow, then i checked my code and the loader program, then i realized that the loader doesn't support interrupts in application. But I need to use two interrupts. Timer0 and external interrupts.
Is it possible.
Renju1988



Joined: 13 May 2015
Posts: 5

View user's profile Send private message

PostPosted: Thu May 21, 2015 11:20 pm     Reply with quote

Is there any way to use interrupts along with my application with USB bootloader.
Ttelmah



Joined: 11 Mar 2010
Posts: 19477

View user's profile Send private message

PostPosted: Fri May 22, 2015 12:36 am     Reply with quote

The USB bootloader allows interrupts in the main code _provided_ you have "USB_ISR_POLLING" defined in the bootloader. This is the default behaviour.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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