![]() |
Forum Index : Microcontroller and PC projects : UBW32 PWM
Author | Message | ||||
Dinosaur![]() Guru ![]() Joined: 12/08/2011 Location: AustraliaPosts: 307 |
Hi All I am trying to make the PWM work on the UBW32, with C32 MX795 image in it. As I can't locate any examples I am hoping someone here can scrutinize my attempts. All the commands come back with "OK", but no freq is detected on any of the pins. If I use the pin as a normal output, (driving an opto) it works correctly. The commands are as per the UBW site, but what I don't know is if you have to set the pin as an output first, or just don't configure it at all prior to setting it for PWM. I have tried both to no avail. Commands in order: PC,4,1 'set to single channel PC,2,1,D,1 'use channel 1 as port D pin 1 PC,1,1000 'Divide 80Mhz to get a 80Khz clk PC,0,2000 'Ticks of 80Khz between pulses, = Frequency PC,5,1 'Enable the PWM SP,1,2000 'roughly 50% duty cycle. Have also tried various orders of these commands, but still no luck. What am I missing ??? Regards Regards Hervey Bay Qld. |
||||
Dinosaur![]() Guru ![]() Joined: 12/08/2011 Location: AustraliaPosts: 307 |
Hi All It appears that a single channel won't work. By setting it to 2 channels, it works. Regards Hervey Bay Qld. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 5950 |
Glad to see you were able to work it out. I have UBW32's but with MM Basic on them. Jim VK7JH MMedit MMBasic Help |
||||
![]() |