Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pic32 PWM?
18-04-2012, 05:26 PM,
#11
RE: Pic32 PWM?
(18-04-2012, 09:59 AM)regis Wrote: In Debug Menu, if you choose USB CDC then debug() is the same as CDC.printf() function.
If you choose Serial then it's the same as Serial.printf().

Hi Regis,

what do you mean by the above? Can you please detail?

What is the "Debug Menu"? I suppose you mean kind of an output window like Arduino has. There however doesn't seem to be something like this in the latest IDE revision - or is it just me who doesn't see it?

Thanks in advance,
/Markus
Reply
19-04-2012, 02:07 AM,
#12
RE: Pic32 PWM?
The Debug-Menu regis meant is a sub-menu of "Pinguino": "Debug Mode".
It should look something like this:

[Image: attachment.php?aid=102]
This was taken with rev. 344 in the x.3 branch.

If you are using the up-to-date x.3, the svn-revision should be given in the window-title (and some other places).

(18-04-2012, 05:26 PM)MarSch Wrote:
(18-04-2012, 09:59 AM)regis Wrote: In Debug Menu, if you choose USB CDC then debug() is the same as CDC.printf() function.
If you choose Serial then it's the same as Serial.printf().

Hi Regis,

what do you mean by the above? Can you please detail?

What is the "Debug Menu"? I suppose you mean kind of an output window like Arduino has. There however doesn't seem to be something like this in the latest IDE revision - or is it just me who doesn't see it?

Thanks in advance,
/Markus


EDIT: I commited the fixes from moreno (thanks!) and some other small things that gave warnings (r347).
The line Debug(); in setup() still needs to be commented out to compile. It is directed to this function in debug.c: void debug(const char *format, ...) ... => too few arguments.


Attached Files Thumbnail(s)
   
Reply
06-06-2012, 12:19 PM,
#13
RE: Pic32 PWM?
Hi there,

I verified that PWM on the MX220 basically works.

My scope suggests the resolution is 8 bit instead of 10 as mentioned in pwm.c. Thus I'd be curious if anybody can confirm that 100% duty cycle is not already reached at 255.

Thanks in advance.
Reply
08-06-2012, 11:47 PM,
#14
RE: Pic32 PWM?
Hi,

in this blog post, I see that the peripheral clock of Pinguino32 boards is supposed to run with 10 MHz (80 MHz CPU clock, divider 8).

Now I spotted in pwm.c, that the reference speed is obviously 20 MHz.

Can anybody please educate me which one is correct? The fact that the MX220 seems to have a maximum CPU speed of 40 MHz (system.c) might have the one or other side effect on PWM as well.

While we're at it: Can somebody please describe shortly how

Code:
PWM.setFrequency()
PWM.setDutyCycle()

are expected to work? I would expect them to work a certain way, but they don't seem to.

I don't see any working way to obtain a 10 bit resolution with an decent frequency (if not setting PR3 statically to 1023 in PWM_set_dutycycle within pwm.c).

Thanks for your time.
Reply
09-06-2012, 12:18 AM,
#15
RE: Pic32 PWM?
I thought you could choose the peripheral clock speed to suit what you want.

John
Reply
09-06-2012, 10:44 AM, (This post was last modified: 09-06-2012, 10:45 AM by mf01.)
#16
RE: Pic32 PWM?
Hi MarSch,

I have run a modified version of /examples/10.Libraries/LiquidCrystal/LCD/lcd-printf-demo32.pde with both the PIC32 Pinguino OTG and the PIC32 Pinguino 220 boards and it reported the following:-

PIC32 Pinguino OTG
Sys.Clock: 80MHz
Per.Clock: 40MHz

PIC32 Pinguino 220
Sys.Clock: 40MHz
Per.Clock: 20MHz

In both instances the default Peripheral Clock appears to run at 1/2 the system clock frequency.

Following up on pingotg's post, there is another example, /examples/01.Basics/clocks.pde, which shows changing the system and peripheral clock speeds although from the comments it appears to be based on a Pinguino with a 80Mhz system clock, e.g. a PIC32 Pinguino OTG.

Regards.
Board = PIC32-Pinguino-OTG Rev C
OS = Linux Unbuntu 11.10 till 26 Apr 2012
OS = Linux Unbuntu 12:04 from 27 Apr 2012
Reply
10-06-2012, 11:50 PM,
#17
RE: Pic32 PWM?
Sorry not to mention it explicitely, but I meant the default clock frequency, of course.

I have to peek into the pwm.c code when I got some more time, since I think the prescaling assumes a given frequency, which is not present for the MX220, hence the number of PWM steps is incorrect.

Thanks for checking this though.
Reply
30-08-2013, 07:58 PM,
#18
RE: Pic32 PWM?
hi friends, look http://www.youtube.com/watch?v=g696I0Rudz8
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)