Micromouse Online


Home
Monday, 01 December 2008
Main Menu
Home
Blog
News
Forum
Articles
Gallery
FAQs
Links
Search






Lost Password?
Syndicate
A bit of a change to Primus PDF Print
User Rating: / 0
PoorBest 
Written by Pete Harrison   
Sunday, 09 September 2007
It seems I made a bit of a mistake in how I thought the dsPIC could drive its PWM module. Consequently, there will have to be some changes.

First, what can't change is the need to use T1CK and T2CK as external inputs to count motor pulses. There are no other choices on the dsPIC30F4011 without using interrupts. Since I anticipate pulse rates of up to 100,000 Hz per wheel, life will be a lot easier not having to service that interrupt rate, even with a fast processor and a very efficient ISR.

Somehow, I had it in my head that the PWM module could use different time bases for each channel. Wrong - and stupid. So, how to produce two independant pulse trains at frequencies from about 500Hz to 125kHz?

Well, the dsPIC has a set of Output compare modules. These are quite capable of  the job and have a variety of useful modes. Each can use one of two 16 bit timers for its timebase. At first sight, it would be best to use the OC modules for both motors and have each derived from a separate timer. Unfortunately, the two timers we can pick form are Timer2 and Timer3. But we have already committed Timer2 to the pulse counting job. That means that only one OC module can be used and it must be driven from a timebase using Timer 3.

This all makes things a bit tacky. The pin assignments are now a little more confusing and earlier posts will need to be edited along with theschematics and such. Hopefully this will be done by the time anyone gets to read this post. Apologies if anyone has done any work based on the errors.

 
Builder's Blog
Latest News
Forthcoming Events
There are no upcoming events currently scheduled.
Events Calendar
November 2008 December 2008 January 2009
Su Mo Tu We Th Fr Sa
Week 49 1 2 3 4 5 6
Week 50 7 8 9 10 11 12 13
Week 51 14 15 16 17 18 19 20
Week 52 21 22 23 24 25 26 27
Week 1 28 29 30 31
Who's Online
We have 1 guest online
Adapted from a design by Joomlateam.com