Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Support => Topic started by: s3c on December 01, 2009, 08:07:19 pm

Title: BP PWM Flaw?
Post by: s3c on December 01, 2009, 08:07:19 pm
So I was working on a ambient light filter for IR receivers and using the BP PWM mode as a signal generator, turns out the PWM mode won't give a 1% duty cycle, is this a hardware flaw or software setup issue?
Title: Re: BP PWM Flaw?
Post by: ian on December 01, 2009, 08:34:05 pm
The duty cycle resolution depends on the length of the period. There's a formula in the datasheet to calculate it. 
Title: Re: BP PWM Flaw?
Post by: ian on December 02, 2009, 11:11:21 am
Expanding on that a little - at very high speeds there may only be 1, 2, or 3 bits of resolution. If the PWM period is only 2 clock cycles, then the duty cycle can only be 0% (0 clock ticks) 50% (1 clock tick) or 100% (2 clock ticks). If this is the case, the Bus Pirate PWM calculator (which uses integer-only math) will round down to 0 for any values below 50%.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.00922039864session_write_close ( )...(null):0
20.00952171440ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.00952172216Database_MySQL->query( ).../DatabaseHandler.php:119
40.05162310928Database_MySQL->error( ).../Db-mysql.class.php:273