Go Down

Topic: Paying $30 for someone to write me a fairly simple mega 2560 program (Read 5945 times) previous topic - next topic

6v6gt

Too late. Already written and sent.  Drinking my $30 beer right now!
Hey. Wait. Don't drink it all. I want my share as well.

6v6gt

So, two input pins, four output pins, for each of seven digits, and a zero button.

That's a hell of a lot of pins you have there, but whatever. Here ya go.

. . .
I like the trick incrementing the button values. Very neat.
If I understood the circuit diagram correctly, only one set of 4 pins Arduino pins is required to load the data bus, irrespective of the number of swiches. The cathodes of the 7 segment displays and the corresponding commons of the rotary switches are pulled low in sequence. During the LOW for a particular display/switch combination, the Arduino must load the values corresponding to the switch (which it replaces) on the data bus.

almstsobur

6v6gt, I think it "could" be done that way, if you went from the Arduino straight to the controlling IC. But for simplicity sake (keeping it just like the rotary switches) I wire the 8421 and common from each switch, I have a picture attached a couple posts back. This allowed me to test and rebuild, calibrate the unit without any other control. I just shorted the wires I needed to get the digits I wanted. That's also why I got the Mega, so I had a shit-ton of pins to work with, keeping its simple from a wire to wire perspective. I'm sure there are cleaner ways going directly to the ICs.

Now, we have a little bit of an issue with the prize beer money. A few hrs ago I got a PM asking if anyone had offered up the code I needed. I replied no, and the beer money was still available. This user said they thought they could cook something up for me for my $30 offer. Couple hrs pass and log back in to a PM saying the code was complete asking for my email Addy to send the code and a PayPal invoice. I obliged. Then I check the thread and see that Paul had posted what appears to be good, usable code from my untrained Arduino eye. I apologize sincerely, but this project can't afford 2 sets of beer money. I thought the thread had died to the wine and cheese crowd wanting me to take out a second mortgage for this programing. I had no idea that seemingly useable code would appear. Though I am confused where I need to populate pin locations in that code, just from a glance. I think this is a fine example of the power of a good beer instead of wine and cheese .


almstsobur

Paul, and 6v6gt for that matter. I do feel as though I owe you guys some time. If you ever need any assistance with ladder logic, Rslogix, VMware, Cisco switching or ASAs, Firewalls, VPNs , 900mhz, 5ghz, or Wonderware programming or configuration, let me know, I will make it happen.

6v6gt

1) If someone has offered $30 for a functioning program for this application, accept the offer quickly before they change their mind. My intention was only to help you get started, not to deliver a working solution.
2) I'm not sure you have understood the limits of your simulation with wires to the switches. A switch can pass anything (AC, DC, 15 volts, morse code etc. etc.). An Arduino pin has 3 possible effective states High, Low and High impedance. You have to ensure that your subsititute switch (ie the Arduino pins) are presenting the right state at the right time. To do that, you have read the strobe on the 'C' pin and put out the right state in response to the strobe.  In the case of the Rotary Switches, each is presenting a high impedance to the databus on all 4 data connections until the strobe on its C pin pulls LOW to read it. Then it presents its set value 0 to 9.

PS. I've just read your new comment as I was typing this. That's great. That's how such a forum should work.

wwbrown

Your project is more complex than you imagine.

You specify Up/Down counters without any user feedback (display). This alone is a killer for me.

You don't specify error conditions.  What happens when the MEGA fails, hangs in reset with all outputs HIGH (1111) which is not a valid BCD character?

What is the ESD environment? Is it in a clean room, or an industrial (dirty, wet, Shakey, Hot, Cold) environment?

You don't specify initial Conditions, min/max ranges.

You don't specify the hardware refresh rate used to read the switches.

How many nanoseconds does the Mega have to update its 4pin BCD output?

Does the hardware 'read' the switches in any specific order.

Are you going to provide hardware for testing?

What is the 'DANGER' quotient?  Does this device control mechanisms that have the possibility to endanger, injure humans?

color me gone.

Chuck.

Very good points that are missed by non-professional programmers.  Kind of like my view on heart  surgery, cut open chest fix heart and close chest.  Three steps should not be worth more than say an oil change since the oil change has the same number of steps.

almstsobur

Very good points that are missed by non-professional programmers.  Kind of like my view on heart  surgery, cut open chest fix heart and close chest.  Three steps should not be worth more than say an oil change since the oil change has the same number of steps.
That's understandable if someone doesn't know the risks, or is looking for code on a re-salable product of some kind and a written re-assurance of the programming work. This was not the case for me at all.  I bought a DC Calibrator in complete non-working order for pennies on the dollar of it's original cost of $5000 when new, I knew the risks. I completely rebuilt the unit and it's for my personal use. I knew by the circuit design alone that no "bad code" could destroy this unit. It's 5V for the love of god, this thing calibrates to 1000v! 5V in the wrong place would merely tickle it's balls a touch, especially in the mA current range. Not to mention there is nothing "breakable" that I can't fix, especially on this unit, I know all 14 pages of the schematic like the back of my hand by now.

    Anyway, I was asking for some help on a beer budget and I got more than that. Pat delivered code that I did not have to modify at all. It worked right out of the box! I never even had to ask any questions, it was all explained quite well in the remarks. I moved some pin assignments and that was it. So, I guess I just lucked out. You can never win the game if you don't pick up the dice. I got more than I could have hoped for from a random request on a forum and I certainly appreciate it. By the way, that's not to say the other 2 codes posted would, or would not have worked, I never tried them and I have no where near the comprehension to say by looking; yet ;) Thanks to everyone that was positive, and thank you Pat for the excellent work.   

As far as the project, here is a picture, it's in a holding pattern until the ribbon wire I ordered gets here, but it's working perfectly. The wiring mess is just test leads, they are coming off when I wrap this up cleanly, so nobody press the panic button! I know how you Arduino guys are, lol :)   

6v6gt

It looks very nice and I'm sure Pat did a great job. It looks like you are testing with only one digit at the moment but that is a good start, especially that it does not interfere with the other digits.
Can you post the code in this thread? I'm curious about how the multiplexing is handled in this solution you have.

almstsobur

It looks very nice and I'm sure Pat did a great job. It looks like you are testing with only one digit at the moment but that is a good start, especially that it does not interfere with the other digits.
Can you post the code in this thread? I'm curious about how the multiplexing is handled in this solution you have.
I have since tested with the last 2 digits and the results are still good. I'm not going to go through testing them all until the ribbon cable arrives. The one issue I did have (no fault of the code) is that the power/ground do have to come the the calibrator itself. I believe in this case being a common Cathode arrangement that ground has to be part of the Arduino circuity. If I just connect the common pin to a ground pin on the Arduino I get the bright LED (bypassing the 7 segment resistors) if I feed the Arduino power/ground from the calibrator itself everything is normal.
 
     As for the code, I am really not sure the etiquette on this sort of thing, but it doesn't feel right to "give away" his work, i'm sorry. He may need some more beer money on down the road :) I'll let him chime in on that, or send him a PM maybe if you have a particular question. One major difference and I i'm not sure what it means entirely, his code had multiple tabs that seemed to reference each other.
 

6v6gt

. . .  As for the code, I am really not sure the etiquette on this sort of thing, but it doesn't feel right to "give away" his work, i'm sorry.  . . .
I'm sure that everyone will see that is  in the spirit of open source and the Creative Commons Attribution Share-Alike license which Arduino operates under. And you did commission it after all, and maybe even paid the  $30 so it is yours to do as you like with. Or did you sign a non-disclosure agreement ?

almstsobur

I'm sure that everyone will see that is  in the spirit of open source and the Creative Commons Attribution Share-Alike license which Arduino operates under. And you did commission it after all, and maybe even paid the  $30 so it is yours to do as you like with. Or did you sign a non-disclosure agreement ?
Yes, I did sign an agreement, a 3 page one! Who reads those things? I didn't until now. I did also pay the $30 :) as agreed. The agreement is pretty clear, if he blows my shit up, he is not liable ;) and it's not my right to republish or distribute his code. As a PLC programmer myself; I completely understand and accept that. That being said, I won't discuss matters of the code anymore, but I will be happy to post some pics of the unit when its all done! 15 buttons and all! 

cedarlakeinstruments

maybe even paid the  $30 so it is yours to do as you like with. Or did you sign a non-disclosure agreement ?
FYI: even without a Non-Disclosure Agreement, unless you have a different agreement, by default copyright remains with the developer. So almstsobur would have a license to use the code, but ownership would still be with Patduino.
Electronics and firmware/software design and assistance. No project too small

PaulMurrayCbr

1) If someone has offered $30 for a functioning program for this application, accept the offer quickly before they change their mind. My intention was only to help you get started, not to deliver a working solution.
I think it would be a good thing in general for people to do their projects out here in public rather than via PM. I think it's probably a good thing for other people to watch how a project gets done.  It's one of the reasons I put my stuff on GitHub when I'm doing a job for cash (I insist on this as an agreed-upon thing at the start).
http://paulmurraycbr.github.io/ArduinoTheOOWay.html

PaulMurrayCbr

I like the trick incrementing the button values. Very neat.
If I understood the circuit diagram correctly, only one set of 4 pins Arduino pins is required to load the data bus, irrespective of the number of swiches. The cathodes of the 7 segment displays and the corresponding commons of the rotary switches are pulled low in sequence. During the LOW for a particular display/switch combination, the Arduino must load the values corresponding to the switch (which it replaces) on the data bus.
Yeah - I thought it would be something like that. My post was really intended as a snark about how the OP hadn't really specified things well. Then again, maybe I'm the one in the wrong, there. He gave a circuit diagram and it's not his fault if I couldn't read it.

Notice, by the way, the syntax for initializing arrays in a constructor. The C++ syntax is pretty appalling, but it does work.
http://paulmurraycbr.github.io/ArduinoTheOOWay.html

Go Up