Go Down

Topic: Im after an arduino sketch writer to breakout an arcade machine im rebuilding. (Read 2941 times) previous topic - next topic


Hello i am after a 1 off Arduino sketch to be written I am rebuilding  and trying to to breakout an old arcade machine im rebuilding. the force feedback is becoming harder than i thought to interface.  I know a bit about electronics but not scripting  well not enough to do this sort of thing . I am wanting to read a pwm signal that has a 30 ?s peak to peak duration " the photo  on this shows the readout from my osc"  and id like to use the duty cycle to be read from this 5v signal to be computed via an arduino board to create a more usable 5v signal across 2 digital pins . eg  less than 48% duty cycle makes a digital pin go to high - pin#1 high/pin#2low , between  49 and 52% no pins are at logic high , 53% and upwards duty cycle makes the second pin go logic high  pin#1 low/pin#2high...
Or if possible to be done from 1 arduino board and if so preferred method  to read this high freq pwm then convert in a linear method and output it to a usable pwm freq say usable do drive a standard Rc "H"bridge via pwm.

im useless at arduino sketching i have tried for years now, i understand to minor points but this is beyond me ,its an art form and skill of its own realm to understand , So name your price $$ ,to do so if your able to and would like to and get back to me  via email :ben.reynolds.au@gmail.com

I look forward to a response and thank you for reading


Since you're asking somebody to do it for you rather than help you understand how to do it, this would be more appropriate in the Gigs & Collaborations section of the forum. People willing to do work for money are more likely to be looking there.


What are the specific durations you want:
less than 48% duty cycle makes a digital pin go to high
between  49 and 52% no pins are at logic high
53% and upwards duty cycle makes the second pin go logic high

Problem as I see it is that 16 MHz Arduino only has 4-8uS sensitivity when using interrupts to make measurement, so you may not get that fine of a granularity in measurements.

1uS = 16 clock pulses.

<=48% of 30uS = <=14.4uS, 230.4 clocks
49% = 14.7uS
50% =           240 clocks
52% = 15.6uS
>=53% = >=15.9uS 254.4 clocks

1.5uS from low range to high range, that only 24 clock cycles of difference.

One method is to use pulseIn( ), measure the high or low times of the signal.
The referencre page says pulseIn( ) returns a number in microSeconds - the ranges you want aren't readily supported.
Might have to get fancier and add some external hardware to gate the signal into a hardware counter enable signal and count the number of system clock pulses.
Perhaps the '328P internal hardware can do this already, probably not as "precisely" with software being involved to set things up. I don't know without more datasheet study.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


thankyou to all that wrote in reply .. i sat back and had a bit of at think about this and pondered what the Hoff would do in this situation and it finaly came to me to make a buffered R,C network and process the signal that was too fast for arduino to read  and break it down to an analog reference voltage and then write a sketch that  picked a center point and referenced the output from that  it works and i even built in an adjustable center dead zone to stop any nasty center oscillations   .. cheers again for any replies

Go Up