[chbot] The next steps for my bot and control board.

Michael Pearce chchrobotics@lists.linuxnut.co.nz
Sat, 30 Sep 2006 19:55:27 +1200


Does the RTOS use time slicing and what timer does it use?

1. Make sure its not the same timer used.


2. It may be possible that the priority of your interrupt 
need to be increased as the RTOS may steal the time your 
code needs, this would make it change the pulse length, and 
will cause the servo to jump around.

3. Try code without the RTOS to start with, to make sure it 
works by itself.

Timing:

10MHz x 4 = 40MHz - 40 MHz/4 = 10 MIPS
10MIP = 100ns/instruction
1.5ms = 1.5e-3 / 1e-7 = 15,000

Your calculations are correct for timer settings with 
prescale = 1:1


You are welcome to pop out to Rolleston if you dont mind a 
drive - have scope and logic analizer available.


Mike

On Saturday 30 September 2006 18:02, Carl Ranson wrote:
> I've tried the same basic technique from within my RTOS
> framework and can't get it going right.
>
> Using it to drive a servo it jumps around randomly
> (freaks out). At first i thought it was a power supply
> noise problem, so i rigged up a seperate supply for the
> servo. No difference.
>
> Its entirely possible that ive got the timing all wrong.
> Im running a 10MHz crystal with PLLx4 enabled (10MHz
> effective instruction clock).
>
> With a timer prescale of 1:1 i would expect that setting
> the period register to 15000 to give me a 1.5ms pulse.
>
> There are enough things i could have done wrong that I'd
> like to measure whats actually going on.
>
> Is there anyone on the west side that wouldn't mind
> giving me 30 mins of scope time?
> Cheers
> CR


-- 
KIWACAN 
Electronics Design
Concept to Production

Mobile:  +64-21-249-5674
Phone:   +64-3-347-3311
Fax:     +64-3-347-2123
Website: http://www.kiwacan.co.nz