|Aug 17, 2010, 06:11 PM|
PIC32 Input Capture Problem/Question
I've just got my self a "PIC32 USB Starter Kit II" so that I can have a play with these processors. I chose the USB version of the starter kit as it has a high end PIC32 on board, 512K of flash and 64K of RAM.
I should probably just add that I have a lot of experience with the dsPIC30 range, although I tend to program these in assembler.
Anyway, the PIC32 is very nice and dead easy to program using Microchip's C32 compiler.
As an exercise I decided to use one of the Input Capture modules to read a PPM Rx output. Worked fine, and used the associated IRQ and handler.
However, as soon as I try to use this configuration in "Power Save Idle" mode it stops working.
I've now been through the data sheet a hundred times, checked and re-checked my code. Tried all sorts of variations, but nothing has worked!
So my question is... Have any of you used Input Capture on a PIC32 and had it wake the CPU from idle mode? (i.e. handle its IRQ and then drop out of idle mode)
Any help or suggestions would be greatly appreciated!
|Aug 17, 2010, 06:49 PM|
Joined Nov 2003
The cpu is halted during that command, so it won't do much at all. The
peripherals are still supposed to work, but you are running the cpu.
Have never used sleep, waking up and maintaining timing might be hard.
See page 12-17, the last page spells it out.
I have had good results by calling the applic people at MicroChip and
other companies. They pay people to answer your questions!
|Aug 18, 2010, 04:05 AM|
I have raised a ticket with Microchip and will post the results here when it gets resolved.
I've read the various datasheets back to front, they imply that the input capture unit will wake the processor when in idle mode with an associated IRQ, and as you say the peripheral should also continue to operate in idle mode.
Certainly in their other processor families this this does happen and works very well as it's something I've used a lot. There is no issue with latency or missed cycles as the input capture units use FIFOs to store their sampled timer values. As such picking up a value in an interrupt handler after the processor has been woken up from idle is not an issue, well unless the captures are arriving extremely quickly! As far as the PIC32 is concerned the timer and ADC peripherals all wake up as expected, I've not tested any of the others but I imagine that they will behave in the same way.
It's also been the case that some of the Microchip C32 libraries contained typos that have caused some people idle/sleep related problems in the past. The affected libraries that I know about, and that shipped with the copy of MPLab I've been using, all appear to have been fixed.
I'm starting to wonder is the problem is somehow related to the fact I'm using one of the starter kit boards, although I can't quite see what would cause this...
|Aug 18, 2010, 07:21 AM|
Joined Nov 2003
I often have trouble the first time I used a feature. There are so many freakin registers and stuff you have to set, it is amazing. Could be something having to do with the I/O bit you are using, did you set the TRIS register?
Reading PIC data sheets is a good way to go to sleep at nite..
|Category||Thread||Thread Starter||Forum||Replies||Last Post|
|Discussion||How to set VirtualDub capture codec from command line?||Kerosene-AU||FPV Talk||0||Aug 17, 2010 07:53 AM|
|Discussion||Sorry - Video Capture Question Again||nking||FPV Talk||4||Aug 06, 2009 07:14 PM|
|Discussion||Got a used CX but it has a problem, need some input.||^jynx^||Coaxial Helicopters||15||Oct 30, 2006 05:16 PM|
|Ap vid capture question||DiabloKid||Aerial Photography||3||Sep 16, 2005 02:39 PM|
|Turning Problem: Input wanted||FLYWINGFAN||Parkflyers||6||May 01, 2003 09:58 AM|