PDA

View Full Version : Pulsin alternative



sbobowski
- 28th September 2008, 21:40
is there such a a thing as a Pulsin alternative?
i'm using a 12F675

right now i have a chunk of code


radioIn:
PULSIN Radio,1,P
' With 20 meg osc pulse measures at 2 millisecs, With 4 meg osc pulse measures at 10 millisecs
PWM NpN, P, 100
goto radioin


Radio is defined as an input,on GPIO.3 save pulse as "P"
PWM NpN is defined as an output on GPIO.2, use P as the PWM Duty, Cycle = 100 (also tried Cycle = 3, which had a better result)
goto = do it forever

OK, i am driving a 12V LED strip with a NPN Transistor. reading data from an R/C Airplane Receiver, this part works good

the problem is that the pulsin command takes up a LOT of time, enough time that you can see the flicker in the LED's (try it it's enough to give you a seizure).

is there an alternative to Pulsin that maybe can do its job a little faster?
or is this where you are better off to find a chip with HPWM and go that route?

thank you in advance

sbobowski
- 28th September 2008, 22:18
ok my problem is in my external components,
i tried playing with the Define PULSIN_MAX that didn't work
i swapped out my 1uf cap for a 4.7uf cap little change
47uf cap great improvement, a little to much capacity though, it makes them sluggish to respond, I'm gona try a 10uf next and i bet that fixes it right up

skimask
- 28th September 2008, 23:31
Switch over to a 12F683 and use the hardware PWM outputs

sbobowski
- 4th October 2008, 01:11
sweet i'm pulling up the data sheet right now!!!
Thank you!!

Bruce
- 4th October 2008, 02:16
Look at the 12F615 too.

xnihilo
- 4th October 2008, 09:21
is there such a a thing as a Pulsin alternative?
i'm using a 12F675

right now i have a chunk of code


radioIn:
PULSIN Radio,1,P
' With 20 meg osc pulse measures at 2 millisecs, With 4 meg osc pulse measures at 10 millisecs
PWM NpN, P, 100
goto radioin


Radio is defined as an input,on GPIO.3 save pulse as "P"
PWM NpN is defined as an output on GPIO.2, use P as the PWM Duty, Cycle = 100 (also tried Cycle = 3, which had a better result)
goto = do it forever

OK, i am driving a 12V LED strip with a NPN Transistor. reading data from an R/C Airplane Receiver, this part works good

the problem is that the pulsin command takes up a LOT of time, enough time that you can see the flicker in the LED's (try it it's enough to give you a seizure).

is there an alternative to Pulsin that maybe can do its job a little faster?
or is this where you are better off to find a chip with HPWM and go that route?

thank you in advance

The resolution of PULSIN is in US:
"The resolution of PULSIN is dependent upon the oscillator frequency. If a 4MHz oscillator is used, the pulse width is returned in 10us increments. If a 20MHz oscillator is used, the pulse width will have a 2us resolution. Defining an OSC value has no effect on PULSIN."