I'm working on a prototype and need to hook up a good amount of hardware to my arduino. I was going to use the nano but if any of you know of one that could handle the load listed below please let me know.
Any advice? The LCD and Keypad are killing me on free pins.
Also one other question. If the keypad and LCD are used to adjust the timer values on the sketch are they retained on power loss or does it load up the original sketch?
The analog inputs can be used as digital pins. So you have 13 + 8 - 2 - 2 = 17 pins available (13 digital, 8 analog, rx and tx already in use, i2c in use).
A common RTC is the DS1307. It uses i2c. If you have a temperature sensor with i2c it doesn't need extra pins.
Four (?) pins for the keyboard.
Six pins for PWM, and one pin for simulated PWM for a led.
That makes 17 - 4 - 6 - 1 = 8 pins left for the display.
If you select the 4-bit databus for the display, you need 7 pins.
In the end, you even have 1 pin as a spare.
My advice : use a shift register 74HC595 for the display and perhaps also for leds. That way you have a few pins spare, because during a project I always need more pins than what I had in mind.
mcreefer:
Also one other question. If the keypad and LCD are used to adjust the timer values on the sketch are they retained on power loss or does it load up the original sketch?
If there is a reset or power loss you the sketch will load and run just like the first time after it was downloaded. That means that the memory locations SRAM used for the variables will either be potentially random or any value assigned to them when they are defined in the code. It is possible to store the data, either using the EEPROM space built into the ATMega ICs or an external data storage device (e.g. a dedicated EEPROM IC, SD Card, etc...).
mcreefer:
Also one other question. If the keypad and LCD are used to adjust the timer values on the sketch are they retained on power loss or does it load up the original sketch?
If there is a reset or power loss you the sketch will load and run just like the first time after it was downloaded. That means that the memory locations SRAM used for the variables will either be potentially random or any value assigned to them when they are defined in the code. It is possible to store the data, either using the EEPROM space built into the ATMega ICs or an external data storage device (e.g. a dedicated EEPROM IC, SD Card, etc...).
So if I use my onboard EEPROM I would just need an option on the LCD menu that writes the changed values to the EEPROM... So I would load the first sketch on the arduino and write an "if" line that checks if anything is on the EEPROM. If nothing is on there copy the values that will change to the EEPROM. If something is on there copy the values into the running sketch... Is that a correct dumbed down way of how this works?
mcreefer:
So if I use my onboard EEPROM I would just need an option on the LCD menu that writes the changed values to the EEPROM... So I would load the first sketch on the arduino and write an "if" line that checks if anything is on the EEPROM. If nothing is on there copy the values that will change to the EEPROM. If something is on there copy the values into the running sketch... Is that a correct dumbed down way of how this works?
Well, sort of...
Fundamentally the EEPROM is just an array of logic gates that are either 0 (i.e. LOW) or 1 (i.e. HIGH), so there will always be some number at an address even if it's a random sequence of 1s and 0s. What you would need to do is set aside a specific memory address that you wirte a pre-determined value if you have actually saved settings you want to retrieve later, much like a flag variable. Then in your setup() function you'd use and IF statement to check against the predetermined value, and if it's there then you retrieve the settings from other address locations in the EEPROM.
mcreefer:
So if I use my onboard EEPROM I would just need an option on the LCD menu that writes the changed values to the EEPROM... So I would load the first sketch on the arduino and write an "if" line that checks if anything is on the EEPROM. If nothing is on there copy the values that will change to the EEPROM. If something is on there copy the values into the running sketch... Is that a correct dumbed down way of how this works?
Well, sort of...
Fundamentally the EEPROM is just an array of logic gates that are either 0 (i.e. LOW) or 1 (i.e. HIGH), so there will always be some number at an address even if it's a random sequence of 1s and 0s. What you would need to do is set aside a specific memory address that you wirte a pre-determined value if you have actually saved settings you want to retrieve later, much like a flag variable. Then in your setup() function you'd use and IF statement to check against the predetermined value, and if it's there then you retrieve the settings from other address locations in the EEPROM.
Very well put. I think this will come in handy. I also think a serial lcd is the way to go for right now. And I will try and trim it down to 6 PWM pins for the sake of keeping it simple. The 7th one was going to controle the fanspeed via mosfet. Any have any other ideas on how to controle it without a PWM pin?