One of the techs at work turned me onto Arduino for a system redesign. My plan was to use an atmel micro-controller, and I was nit-picking at the details of power decoupling and he said "Hey! take a look at this." Wow, what an amazing concept! These little boards are neat for the price, and are perfect for my one-off projects.
What I'm hoping to get feedback for is primarily how I should approach my software setup for this project. More specifically:
* Should I fuss with interrupts? Or should I just write one big loop that goes on until power is shut off? I could, for instance, tie my switch changes to interrupt pins...
* Should I store data on my system layout and write simplified code that processes this data, or should I hard code it all into instruction memory?
* How should I handle memory and instruction memory faults? I need to understand the possible failure modes and be able to address them with additional components.
The project is a high pressure test system. The controller will sample the states of DTSP switches (on-off-on) to determine the state of valves (driven by relays) and light indicators (R/Y/G/Off Quad-state). The controller will also need to take into account various fault conditions and respond appropriately. On top of all that, my controller will need to be able to tell my computer what it is up to (What are the valve and fault conditions), and take input from the computer (if a particular switch for a control is in the middle position, then the computer is driving that control).
The vast number of I/O I need for this has led me to the Seeeduino Mega. Nice little board. I've already programmed a few example/learning programs on it just to familiarize myself with the platform (I've been programming for years, but only messed with MCUs back in my college days for a senior project).
My goal is to route all the signals via a "shield" that will adapt to the top of the Seeedunio Mega, and those signals will go through what ever "glue-logic" is needed into ribbon cable headers. The ribbon cables will terminate on DIN Rail terminal blocks (such as Altech FBK34 and such) and from there go to my various components.
The software I'm using on the computer to communicate with the MCU will be coded in LabVIEW. I've played around with this already, and am confident that this will work... I think
. I definitely need to be careful not to lose this USB connectivity functionality by having something on a PIN that interferes with this (It looks like most of the pins are multi-functional).
I've worked out a spreadsheet of all my connections against Seeedunio pins so I can start making some decisions on what I want, where. Already I'm seeing a need to move some of my outputs around.
Here is a link to that table (Excel 2003, let me know if you want me to convert it to something else), as I think it illustrates the size and scope of my project. :o
Edit: I guess I will post it in my follow up message because it is telling me I need to post 1 normal message or something.... I guess spam has to be fought somehow.
Thanks for your input! I'm really excited to get going on this Arduino approach to MCU design as it compliments my job requirements very well. It is also refreshing to see a thriving community around it ;D.