Pages: [1]   Go Down
Author Topic: Im after an arduino sketch writer to breakout an arcade machine im rebuilding.  (Read 1915 times)
0 Members and 1 Guest are viewing this topic.
adelaide
Offline Offline
Newbie
*
Karma: 0
Posts: 8
SAVE THE LASERS!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* 1921999_10152667786033222_1555274198_n.jpg (118.29 KB, 960x720 - viewed 39 times.)
Logged

*----[LASERS]----*

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 27386
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* pulseWidthCounter.jpg (51.83 KB, 960x720 - viewed 41 times.)
« Last Edit: March 11, 2014, 11:46:54 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

adelaide
Offline Offline
Newbie
*
Karma: 0
Posts: 8
SAVE THE LASERS!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
smiley
Logged

*----[LASERS]----*

Pages: [1]   Go Up
Jump to: