Read Darrel comment above.
You have to setup manually, or you can use 2 CCP HPWM only with PBP
Read Darrel comment above.
You have to setup manually, or you can use 2 CCP HPWM only with PBP
On these chips, I defer to Bruce's experience. (See post #4)
Bruce,
Is there really 2 normal CCP's and 4 other PWM's on these chips? Total of 6?
Or am I looking at the datasheet wrong?
The GIF image in post #4 shows 6 traces, but the program doesn't ues CCPCON?.
Haven't used one yet.
<br>
DT
DT,
The 28-pin version has 6 power control pwm outputs, and 2 standard CCP pwm outputs
for a total of 8. The 40-pin has 8 power control pwm outputs and the 2 standard CCP.
The only thing I don't like is they use the CCP1 & CCP2 pwm outputs as power control
pwm fault inputs.
You should grab a couple samples. The motion feedback module on these is awesome.
WOW, that's a tough read.
But after a few hrs in the datasheet. Yeah, these are cool.
Got the (IC) Input Capture block: Very cool.
The (QEI) Quadrature Encoder Interface: OK sorta cool.
And up to 4 14-bit PWM's. (4 additional complimentary outputs) Not usable with CCP's at the same time.
Not as cool as I expected.
Still worth further investigation.
Samples on order. Thanks Bruce.
<br>
DT
How about a 28-pin PIC24FJxxGA002. 5 independent input capture AND 5 independent PWM's/OC (up to 16-bit resolution and 500kHZ). About $2 each (depending on flash from 16-64kB, 4kB or 8kB RAM). Plus lots of other stuff like 2 UART's, built-in RTCC, 2 SPI, 2 I2C, etc. Plus you can select which pins you want to use for most of the peripherals.
Thanks did not know that ccp and pwm0-5 are not the same pins that helped now how about setuo for timer 2.
If you're using HPWM you don't need to mess with Timer2. It's automatically handled
for you.
If you plan to setup hardware PWM manually, these calcs should help.
Search here for HPWM and you'll find a boat-load more examples.Code:PR2=(Fosc/(4*PS*Freq))-1 TMR2 Prescaler = 1 PR2 = (8MHz/(4*1*12,000)) = (8MHz/48,000)-1 PR2 = 165.666 TMR2 Prescaler = 4 PR2 = (8MHz/(4*4*12,000)) = (8MHz/192,000)-1 PR2 = 40.666 TMR2 Prescaler = 16 PR2 = (8MHz/(4*16*12,000))-1 = (8MHz/768,000))-1 PR2 = 9.416 CCPR1L:CCP1CON<5:4>=(PR2+1)*4*Duty% (165+1)*4*0.5 = 332 (40+1)*4*0.5 = 82 (9+1)*4*0.5 = 20 To load the duty cycle registers just place the value calculated in a word, and do something like this; Duty = 332 ' Roughly 50% duty cycle CCP1CON.4 = Duty.0 ' Setup 10-bit duty cycle as CCP1CON.5 = Duty.1 ' a 10-bit word CCPR1L = Duty >> 2
Bookmarks