PIC PWM registers

May 04, 2006 9 Replies

Hi,



I wrote a PWM calculator and code generator :



formatting link



This may help anyone fighting with PIC PWM registers calculations...



Questions & comments are welcome



Bruno


I tried it and the code window was blank.

Specs were: 4MHz, 400Hz and 50%.

Al

"Al" a écrit dans le message de news: snipped-for-privacy@news.verizon.net...

Hi Al,

I tried with your specs, this is what you should have got :

/*

  • PWM registers configuration * Fosc = 4000000 Hz * Fpwm = 400.64 Hz (Requested : 400 Hz) * Resolution is 10 bits * Prescaler is 16 * Ensure that your PWM pin is configured as digital output * see more details on
    formatting link
    * this source code is provided 'as this', * use it at your own risks */ PR2 = 0b10011011 ; T2CON = 0b00000111 ; CCPR1L = 0b01001101 ; CCP1CON = 0b00111100

the calculator uses advanced javascript functions, I tried with the latest release of IE, Opera and Firefox. Is your navigator up to date ?

Thanks,

Bruno

formatting link

Très bon.

Best regards, Spehro Pefhany

"it\'s the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

Hi Bruno,

white text on white background doesn't look good in the source code window....

greets, Wolf

From-address is Spam trap Use: wolfgang (dot) mahringer (at) sbg (dot) at

"Wolfgang Mahringer" a écrit dans le message de news: ixo6g.14$ snipped-for-privacy@news.salzburg-online.at...

Hi Wolfgang,

It seems that some browsers do not apply the black background color from the tag correctly, so I removed it, and font tag too.

the code is now printed black on a white background, and should be convenient for all users.

Thanks ;-)

Bruno

formatting link

"Spehro Pefhany" a écrit dans le message de news: snipped-for-privacy@4ax.com...

;-)) Thanks !

Bruno

formatting link

BrunoG scrobe on the papyrus:

I'm using Opera version 8.51 and I still don't see any code only a large table of values. Where should I be looking for the code listing?

John B

formatting link
ml

Looks good, thanks. Is there something similar for the USARTs, and other things requiring multiple register settings where it is so easy to make a mistake? Bob

"Bob Eld" a écrit dans le message de news: mOp6g.67355$F snipped-for-privacy@newssvr29.news.prodigy.net...

Hi Bob,

It's a little bit different for USART but I'm thinking about it ;-)

Thanks,

Bruno

formatting link

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required