Lynxmotion Tech Support

www.lynxmotion.com
It is currently Mon May 20, 2013 11:09 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Sep 15, 2011 12:00 am 
Offline
Roboteer

Joined: Wed Sep 14, 2011 11:47 pm
Posts: 4
hi,
can anyone explain setting procedure of real time clk(RTC)?




thanks


Top
 Profile  
 
PostPosted: Thu Sep 15, 2011 9:07 am 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4414
My guess is you are "mini" on the BasicMicro forums :D. So I know that you are asking about a BAP40, which underlying chip is the H8/3687 which has RTC support, but I am pretty sure it requires an external 32.xxxmhz crystal to be fed into the chip, which I am pretty sure is not on the BAP40. Nathan(AcidTech) is the best one to say for sure.

Kurt


Top
 Profile  
 
PostPosted: Thu Sep 15, 2011 10:45 am 
Offline
Roboteer

Joined: Wed Sep 14, 2011 11:47 pm
Posts: 4
kurte wrote:
My guess is you are "mini" on the BasicMicro forums :D. So I know that you are asking about a BAP40, which underlying chip is the H8/3687 which has RTC support, but I am pretty sure it requires an external 32.xxxmhz crystal to be fed into the chip, which I am pretty sure is not on the BAP40. Nathan(AcidTech) is the best one to say for sure.

Kurt



Of course your guess is correct.Actually my doubt is that in pid controller program we should give dt value for calculating ki and kd. So I thought that it would be possible with RTC.But i don't know how to use it. Is there any other function to get the loop execution time.


Top
 Profile  
 
PostPosted: Thu Sep 15, 2011 10:57 am 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4414
If you write your code in assembly language you can count clock cycles (been there, done that... for writing my own Serin/serout).

Or you can setup and use one of the other system clocks, such as TimerZ0/1(16 bit), TimerV(8 bit) or TimerB1(8 bit). These will be in some multiple of clock cycles (20mhz on Bap40 I believe). Depending on the length of time you need and resolution and which clock you use, you will probably need to setup an overflow interrupt and handler. Not hard, I have several examples up on the forum, including the thread: viewtopic.php?f=4&t=3496

Kurt


Top
 Profile  
 
PostPosted: Thu Sep 15, 2011 11:02 am 
Offline
Roboteer

Joined: Wed Sep 14, 2011 11:47 pm
Posts: 4
Thanks for your reply and I'll try to do it using timers.


Top
 Profile  
 
PostPosted: Mon Sep 19, 2011 1:45 am 
Offline
Roboteer

Joined: Wed Sep 14, 2011 11:47 pm
Posts: 4
I read in the 3664 manual that the real time clock time base function is available when a 32.768khz crystal is connected to it. That means I have to connect the crystal externally or is it there on bap40? Can't we use that function without crystal? Will you give any example of real time clock time base function?


Thanks


Top
 Profile  
 
PostPosted: Mon Sep 19, 2011 8:50 am 
Offline
Robot Guru
User avatar

Joined: Sat Apr 15, 2006 1:42 pm
Posts: 4414
Yes the 3687 chip used on the Basic Atom Pro 40, Arc32, and Mad Hatter can have a RTC with the external crystal. But Basic Micro did not attach one to any of the boards other than the Mad Hatter. They also did facilitate any easy way to add them either. It may be possible to attach some jumpers to the actual processor and try to hook one up, but it will also probably require a couple of capacitors as well... If I tried it, I would end up destroying the board...

Kurt


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group