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 support@ccsinfo.com

Using CTMU and RTCC at the same time

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



Joined: 19 Oct 2011
Posts: 31

View user's profile Send private message

Using CTMU and RTCC at the same time
PostPosted: Sat Nov 10, 2012 7:04 am     Reply with quote

Has anyone successfully used the CTMU and the RTCC at the same time? I ask because I see they both use timer1.
However I see that the CTMU can also use other sources:
The level-sensitive input edge
sources can be selected from four sources: two
external inputs, Timer1 or Output Compare Module 1.

However, I don’t think any of the other sources will work for my application.
The goal is to use the RTCC to keep track of the current time and date, then when a touch occurs using the touch input it stores the time , date and data in a flash.

I will most probably use a 32KHz crystal for the timer1 osc for the RTCC. If the two units (RTCC and CTMU) share timer1, I don’t know if the crystal will be too slow for the CTMU. Or if they are even allowed to share the timer1.

Anyone have any thoughts? I do not have any code yet, as I am trying to nail down my hardware. If I can’t share the timer, then I will have to use an off board RTC.

CCS Compiler 4.137
Device: 18F27J53 (although not set in stone, until I figure this out).
Ttelmah



Joined: 11 Mar 2010
Posts: 19469

View user's profile Send private message

PostPosted: Sat Nov 10, 2012 8:40 am     Reply with quote

Depends what you want to do, and accuracy required.

The RTCC, can run from Timer1, _or_ the internal RC. If you don't need great accuracy the latter may be suitable.

Then as you say, the CTMU, can use Timer1 as its edge source, or two external pins, or the output compare/PWM1 signal. So potentially three other sources not involving Timer1.
You could (for instance) if you have an available pin, always use another timer, and just feed it's output into one of the edge source inputs, or really best just use PWM1.

Best Wishes
temtronic



Joined: 01 Jul 2010
Posts: 9208
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Nov 10, 2012 12:05 pm     Reply with quote

Since this sounds like a 'datalogger' application...

...I'd opt for an external RTC like the DS1307.While you could go for just the PIC, you also have to have a battery backup for the PIC to keep time '24/7'.
Also you 'offload' ALL of the timekeeping functions to the 1307,allowing the PIC to do more.Maybe not critical now but 3-4 revisions from now you'll 'need' to do more...always happens.
And the 13070 can be programmed to send the PIC an interrupt..

hth
jay
mtsoule



Joined: 19 Oct 2011
Posts: 31

View user's profile Send private message

PostPosted: Sat Nov 10, 2012 12:38 pm     Reply with quote

thanks temtronic, thats what i am going to do. these are just protos anyways so no biggie. i am going to have an external RTC, but i am still going to try to get the internal to work right with the CTMU.

But if not then i have my external to fall back on, want to keep the production units as small as possible, natually.

Actuall the RTC i had planed is the PCF2123 from NXP. wish i could use the DS1307, but i need 3.3V, think 1307 is a 5V part
temtronic



Joined: 01 Jul 2010
Posts: 9208
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Nov 10, 2012 3:07 pm     Reply with quote

yes the 1307 is a 5 volt part.
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