My son and I are doing a project that will require close to 50 inut / outputs, so the Mega 2560 looks like what we need.
If this works, we want to make more copies of this project. I know if a project is based on the uno, you can put just the chip on the PCB. Can we do this with the chip from a Mega, or would we be better off just buying more Megas?
If this is possible, could someone point me in the right direction on how to do this?
Can we do this with the chip from a Mega, or would we be better off just buying more Megas?
You will have a much harder time removing the chip from the Mega that from the Duemilanove or UNO. Depending of your skills with a soldering iron, it might be easier to just buy more Megas.
Megas are surface-mount chips. Tiny, tiny pins to be soldering by hand. There are options available to have them fabricated by a production house, if you're ordering in quantity. Or, you can learn how to do SMD PCBs yourself. It's not trivial, but not impossible.
You might think about IO expansion on through-hole chips instead. Look into shift registers, for starters.
It may depend on how many you intend to make, Megas are expensive so if this is to be a commercial product you really should build your own board, soldering those chips is not rocket science but you certainly have to hold your mouth right.
I have a mate who just had a few (8 I think) boards loaded with the hard bits (including a 2560) for his invention, it wasn't real cheap but OK. See here
Thanks for the responses. Confirms what I suspected.
The project is for our own version of a guitar effects pedal controller. Originally inspired by this: A Remote Indicating Effects Bypass System, but after all of the changes / features we keep addining, it only has a slight resemblence to the original.
Right now we are at 44 input / outputs (LCD, LEDs, Stomp buttons, relays, etc...).
He is talking about some more features that could add up to 12 more IOs, so we are filling up the mega pretty fast.
We have tested all of our needed programming and electrical proofs individually, and did a small scale test of all our programming concepts combined on the uno (used all the digital IOs).
We now have a mega, and have ordered all of our parts, so hopefully in the next few months we will have our prototype up and running.
We also made our first PCB (acid etched a copper clad board). So that is one more thing to check off our list of things we need to be able to do.
There are a few friends who say they want one if it works like we think it should (plus my son has dreams of selling some - we will see about that way down the road).
If you are doing any quantity, then order ten 100mm x 100mm boards (max) for $24.90 from iteadstudio.cop, much more reliable way to go.
Solder masked, labeled, the works.
Yeah, dude... You could easily do this with through-hole parts if you use a couple shift registers. There's really no need to use a Mega unless you must have the UARTs or memory that you just can't get on the lower end chips.
I mean, if really want to, knock yourself out -- but absolutely consider the easier route first.
If you buy atmega2560 you will have to learn about bootloading and isp, I've soldered one tqfp chip before and its not so bad with the hot air method and solder paste, definetly needs a custom pcb tho,
Yes.. to clarify, with the shift registers, you send (serially -- via clock, latch, and data pins) the output levels for the 8 outputs. If you need more than 8, you cascade one shift register into another (they're made to daisy-chain) and send 16 levels instead. All 8/16/24/whatever outputs are individually addressable and are simultaneously active. No duty cycle.
The other benefit to using shift registers is that, while it takes slightly longer to send the data serially, all parallel output levels are effective at the same exact time. (Or, within about 15uS anyway.) So there's no latency between turning on pin 1, then 2, then 3... Sometimes this matters, usually it doesn't. I'm taking advantage of this to communicate with the parallel interface on the SNES SPC-700 sound chip, for example.
Can't PWM relays, you want those either on or off.
LEDs, no problem multiplexing. Idea is to pulse each on at fast enough rate that they all look on.
Could even do something like use SPI.transfer() to some shift registers wired in series, say you had 3:
do 3 SPI.transfer() to send out the updated status of whatever is connected, then you are not multiplexed at all, can get by with a smaller chip that way too.
'328s & '1284s are way less expensive than a '2560, both available in DIPs, easier to work with.