Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 01:43 07 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : UBW32 PWM

Author Message
Dinosaur

Guru

Joined: 12/08/2011
Location: Australia
Posts: 304
Posted: 07:57pm 26 Oct 2014
Copy link to clipboard 
Print this post

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: Australia
Posts: 304
Posted: 06:13pm 27 Oct 2014
Copy link to clipboard 
Print this post

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: Australia
Posts: 5914
Posted: 06:17pm 27 Oct 2014
Copy link to clipboard 
Print this post

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
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024