PWM as a GPIO on the 56F8345

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PWM as a GPIO on the 56F8345

4,328 Views
Cowboy
Contributor I
Hi
I'm struggling to get my PWM to work as a GPIO (or an output for that matter). I want to drive 2 leds on each port as debug leds.
 
I've set the PMOUT register to software control and enable the PAD_EN
I've set the PMCFG register to Independent.
When i write to the PMOUT register to set or clear OUTx bits all six channels go on and stay on.
the only way I get a response from my PWM is when I set TOP or BOTTOM NEG bits in the PMCFG register
 
Any Ideas are welcome
 
Thanx


--
Alban Edit: changed P/N is subject line.


Message Edited by Alban on 2007-10-15 11:37 AM
Labels (1)
0 Kudos
8 Replies

843 Views
Devendra
Contributor I
Hello Cowboy
 
You want your PWM to work as an output (GP O), you can write (0) ZERO to the corresponding PWM_UPDATE_VALUE_REG to turn OFF the output or to turn the output ON, you have to load 32767 in the PWM register.
 
I have used this for other controllers and only the concern is the speed of updation of this value. If your application is not time critical, you can put some software delay after you give an UPDATE_VALUE command.
 
You can try out this.
It really works quite well.
 
Regards,
Devendra
0 Kudos

843 Views
Cowboy
Contributor I

Hi Devendra

This is the only registers that I have

See Attachments for more info

PMCTL Control Register Read/Write Section 11.10.1

PMFCTL Fault Control Register Read/Write Section 11.10.2

PMFSA Fault Status & Acknowledge Register Read/Write Section 11.10.3

 PMOUT Output Control Register Read/Write Section 11.10.4

 PMCNT Counter Register Read-Only Section 11.10.5

PWMCM Counter Modulo Register Read/Write Section 11.10.6

 PWMVAL0-5 Value Register 0-5 Read/Write Section 11.10.7

 PMDEADTM Deadtime Register Read/Write Section 11.10.8

 PMDISMAP1 Disable Mapping Register 1 Read/Write Section 11.10.9

 PMDISMAP2 Disable Mapping Register 2 Read/Write

 PMCFG Configure Register Read/Write Section 11.10.10

PMCCR Channel Control Register Read/Write Section 11.10.11

PMPORT Port Register Read/Write Section 11.10.12

 PMICCR Internal Correction Control Register Read/Write Section 11.10.13

Thanx

0 Kudos

843 Views
Cowboy
Contributor I
Here are some more info
0 Kudos

843 Views
Devendra
Contributor I
Maximum value for PWMVAL is 32767 and Minimum is 0.
0 Kudos

843 Views
Devendra
Contributor I
You can put Maximum value in PWMVAL(0..5 as per your output used) register to set 100% duty of PWM (Output continuously ON) and put 0 in PWMVAL to turn OFF the output.
 
I am also using PWM output, acting as an Output like this. Hope this helps.
0 Kudos

843 Views
Alban
Senior Contributor II
Hello and Welcome to the forum Cowboy,

Are you sure the 8345 is a 16-bit product ?
Please reply indicating the full part number as I suspect it is either a Power or ColdFire...

Many thanks,
Alban.
0 Kudos

843 Views
Cowboy
Contributor I
Hi Alban
 
From the MC56F8300 user manual on freescale's website they say that the 56F8300 16-bit hybrid controllers
 
My part number that I'm using
 
MC56F8345MFGE
0 Kudos

843 Views
Alban
Senior Contributor II
Thanks Cowboy,
This is indeed the right place for these.
The partial part number midlead me towards the MPC8xxxx series. I update the post subject so readers see it's the 56F series.

Cheers,
Alban.
0 Kudos