Mimic PWMOUT on other pins

Michael 2727

Senior Member
Is there a clever way to mimic pwmout on other pins ? (08M Chip)
Either in phase or reversed.(08M Chip)
Or a way to use divisions of the PWMOUT on other pins at the same time ? (08M Chip)
 

Michael 2727

Senior Member
Thanks Technical,
I know about hpwm and the 14M.
But I was interested in the 08M chip.
I was looking for a way to divide the PWMOUT
to get lower frequencies than 4Khz also.
( without using OSCAL )
 

Fowkc

Senior Member
You could use PULSOUT on one pin for the HIGH part of the duty cycle, then use PULSOUT again on a dummy pin for the pause.

I've used this method with great success to make an RGB colour washer thingy.
 

vk6bgn

New Member
Michael,

This short piece of code is what I use on my electric scooter. I've never actually viewed the output on a scope but you can hear the low growl of the pulses. So I'm sure it's not at the normal 4000Hz. minimum and it's only on the PWM pin. So I don't know if that helps?

chopper:
READADC10 1, W0 'read the 0-5vdc throttle voltage and put the value into word W0
PWMOUT 2, 200, W0 'pulse out on pin 2 of the 0-8M chip
POKE $12, $06 'spooky stuff goes on here, see note below
GOTO chopper

Note:
This POKE's the T2CON register (spooky stuff, I don't really know what this register is for, but works here like a pre-scaler)
POKE $12, $05 'provides a pre-scale of 1:4
POKE $12, $06 'provides a pre-scale of 1:16

If the 08-M minimum PWM frequency is about 4000Hz. It can be scaled down to around 1000Hz. or 250Hz. respectively. But on the PWMOUT pin only.

Note: POKE must be after the PWMOUT or it didn't seem to pre-scale at all.

I have seen some code around that I think(?) pulses a digital output with variable pulse width etc. etc. I think all you had to do is feed the variables in the code with the right info and magic…… PWM out!. But then I'm no software engineer, I just tinker around out in my workshop.

"The Addict"


 
 

Michael 2727

Senior Member
Thanks Fowkc, Addict that seems to work well, Gold Star *.
I don't have anything in mind at present, just that 4KHz being the Min PWMOUT frequency
was bugging me ~ ;o)
 
Top