EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

dsPIC33FJ128MC802 PWM motor control

Started by KM6VV September 13, 2008
Hi John,

I see you're a ham too! I'm KM6VV. Central coast, CA.

I'm starting a dual motor control project for a microbot robot. Two DC
motors with encoders (Lynxmotion), and a dsPIC33FJ128MC802.

I'm currently playing with application note 696 code on an 18F4620 while
I wait for the dsPIC. The ds is a little different! I've not yet
figured out what are the comparable settings for the PWM. And then
there's the encoder. That may be the easy part!

I'd love to find an appnote for the dsPIC33. Have you seen any?

When running the '452 code (AP696 w/ 20MHz XTAL) on the 4620 (10 MHz and
PLL) I can't get set up 20 kHz PLL output for my motors! I'm trying:
OpenPWM1(0xFF); // Setup Timer2, CCP1 to provide 19.53 KHz PWM @ 20MHz
//OpenPWM1(0x7F); // KILLED IT Setup Timer2, CCP1 to provide 19.53 Khz
PWM @ 20MHz

//OpenTimer2(T2_PS_1_1 & T2_POST_1_10 & TIMER_INT_ON); /* 25 uS period
40Khz */

OpenTimer2(T2_PS_1_4 & T2_POST_1_10 & TIMER_INT_ON); /* 100 uS period
10Khz */

I'd prefer to run with the 10MHz xtal and PLL.

Any ideas?

Alan KM6VV


The 2024 Embedded Online Conference