BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 7:57 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: HPWM / frequency
PostPosted: Thu Feb 02, 2012 8:39 am 
Offline
Guru

Joined: Sun Dec 20, 2009 10:52 pm
Posts: 76
Hi,

I have a strange and sudden problem with the HPWM on the BAP24.
Before with a period of 800, I was getting a frequency of around 20000 Hz, now I get only 312.5 Hz?
I tried 3 different BAP24 and I changed my programming board and I still have the same results.

Any solutions or at least explanations?

Thanks

Chris


Top
 Profile  
 
 Post subject: Re: HPWM / frequency
PostPosted: Thu Feb 02, 2012 10:26 pm 
Offline
Guru

Joined: Sun Dec 20, 2009 10:52 pm
Posts: 76
Sorry, it's now working again, here is the code I put below :

Code:
period=400
duty=period/2
hpwm p10,period,duty


I was looking for a specific frequency but to work I needed to add :

Code:
period=400
duty=period/2
hpwm p10,period,duty
main:
goto main


Thanks Nathan for your help

Chris


Top
 Profile  
 
 Post subject: Re: HPWM / frequency
PostPosted: Fri Feb 03, 2012 10:57 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Also if you just let your program end on its own the chip will go into sleep(en END command is added to the bottom of all basic programs automatically) which may be why the frequency was wrong. The main:goto main causes the program never to get to the end so it doesn't go to sleep.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


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

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] 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

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

phpBB SEO