BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Thu Apr 26, 2018 11:38 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: basic micro HPWM period problems
PostPosted: Fri May 14, 2010 2:13 pm 
Offline
Citizen

Joined: Fri May 14, 2010 1:47 pm
Posts: 6
Hi there,

I'm trying to get the hpwm command to make period pulses of 10000us on the basicatom 24-m board.
The atom_manual says the following:

Quote:
HPWM pin,period,duty

Period is an expression of the period of the pulse width signal in
microseconds(us).


i do the following:
Code:
select con 0
period var long
duty var long

period=10000
duty=5000

HPWM select, period, duty


but end up with a period of 500us. so i figure to multiply <period> and <duty> by 20 to get 10000us but end up with a period just below 200us. am i using the hpwm command incorrectly or is something else amiss here?


Top
 Profile  
 
 Post subject: Re: basic micro HPWM period problems
PostPosted: Fri May 14, 2010 5:59 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
The largest period on the Atom or Nano processors are 16383(eg 0x3FFF). Any bits over that range are lost. That is causing the 200us because the high bits after the times 20 are being dropped.

The slowest HPWM on a 20mhz Atom is 819us or about 1.22khz

The slowest HPWM on the Nano is 4 times slower, 3.276ms.

The AtomPro has a much larger range fo its HPWM, max range of 524287 but it is in clock cycles(eg no devide by 4) so it's longest period is mhz/524287(32.768ms at 16mhz or 26.2144ms at 20mhz).

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: basic micro HPWM period problems
PostPosted: Wed May 19, 2010 8:00 pm 
Offline
Citizen

Joined: Fri May 14, 2010 1:47 pm
Posts: 6
Acidtech wrote:
The largest period on the Atom or Nano processors are 16383(eg 0x3FFF). Any bits over that range are lost. That is causing the 200us because the high bits after the times 20 are being dropped.

The slowest HPWM on a 20mhz Atom is 819us or about 1.22khz

The slowest HPWM on the Nano is 4 times slower, 3.276ms.

The AtomPro has a much larger range fo its HPWM, max range of 524287 but it is in clock cycles(eg no devide by 4) so it's longest period is mhz/524287(32.768ms at 16mhz or 26.2144ms at 20mhz).


thanks that helped me out :)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 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

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO