ATMega standalone ICSP setup

Hi all,

I am new to this forum and to the marvels of the Arduino. I’ve spend several months fiddling around, trying different designs and getting boards fabricated to see how it goes. Now I’d like to get one to actually work as intended XD

The enclosed board / schematic is designed to work on my scooter (12-15VDC power) and basically to drive LEDs in the instrument cluster according to following inputs:

Battery voltage (BATT_POWERED input)
Input from a rotary encoder with included push-button to light up selected tell-tales (ENCODER_PIN1; ENCODER_PIN2; ENCODER_PB)

Cluster lighting is driven directly via 2 LM1117 power regulators, the third regulator powers the ATMega and a 74HC595 shift register. The LEDs won’t appear on this particular board, as they are attached to other PCBs in the cluster, hence the resistors connected to the headers.

Could some of you please have a glance at the board and help me answer the following:

I have included an ICSP header onto my board to update the program now and again: is it set-up correctly?
I have noticed I have to disconnect all output pins to program an Arduino Uno board to avoid ‘get sync’ errors, how can I do that on my project as everything is connected to the same ground plate?
Is the rotary encoder hooked-up correctly to the ATMega?
Have I forgotten any caps and whatnot to make my ATMega work standalone?

Of course, I’m more than willing to provide you with any further details you might need to answer all these questions!

Thanks A LOT for your help :wink:

Fred

PCBArduino6.brd (118 KB)

PCBArduino6.sch (236 KB)

If you leave the Aref open with a 100nF capacitor to ground, you would be able to use the Arduino libraries for DEFAULT and INTERNAL reference. http://arduino.cc/en/Reference/AnalogReference

I know the LM1117 requires 10uF tantalum capacitor at input and output, but I would still add 100nF near the ATmega328. You can't use any capacitor with the LM1117, it is specified for tantalum capacitors. The 12V input should have a filter to filter high voltage spikes.

When you draw a schematic, please use the components in normal way, not rotated. You also don't have to combine the grounds, it is no problem if the ground symbol is used repeatedly many times.

Take a look at the schematic of the Pro Mini. http://arduino.cc/en/Main/ArduinoBoardProMini

The reset has 10k to +5V, not to ground. Aref is not connected to 5V, but open, with capacitor.

You use a shift register for 8 extra outputs. You need 3 I/O pins (latch,74sck,ser) and you still have 6 spare pins (assuming you can use ADC6 and ADC7). So if you remove the shift register, you have 9 spare pins and you need only 8.

The ICSP has the right pins, but I don't know if anything connected to those pins is low impedance. If it is 1k or higher you are okay, if it is lower, a timing problem is more likely to occur.

Thanks a lot for your help, I'll get back to the drawing board right away :)

I have indeed bought tantalum caps for my LM1117.

Being able to use analog pins as outputs is a very nice surprise. From my early research, I see now I just misunderstood arduino's reference about analogWrite() function. I thought it only applied to digital pins... my mistake !

Cheers,

Fred

Is it just me, or is there no ' enclosed board / schematic " to look at?

I can't see anything either. And I think there have been other threads with the same problem.

Is this related to the Forum upgrade?

...R

Nope, sorry guys, I had removed them... They're back online!

Fred

ICSP is usually a 2x3 header to interface with 6-pin connector on a programmer. http://www.atmel.com/tools/avrispmkii.aspx

Having a 1x6 is not unusual, you'll just need to make a little adapter cable.

Yes I know 1x6 is a bit unusual, but I chose this design to squeeze the header at the edge of the PCB.

And since my project is going to be housed inside the instrument cluster, I’ll solder my ISCP pins to a cable which I’ll use to reprogram the board when needed, without having to disassemble the whole scooter time and again :wink:

Fred

Hi all,

Here is the updated project based on your advice. I still have an issue: Caltoa suggested I use ADC6 as output, but I just looked this up and it seems ADC6/7 pins cannot be used as outputs even on the TFQP ATMega328, so I’ll have to simplify my project a bit.

Cheers,

Fred

PCBArduino7.brd (110 KB)

PCBArduino7.sch (220 KB)

ADC6 and ADC7 can be used if you read and write directly to the registers. They can also be used with the Arduino libraries if you use a Arduino Pro Mini compatible board. http://arduino.cc/en/Main/ArduinoBoardProMini

You use 100 ohm for the led ? I think that is too much current for the led. What kind of led are you using ? Something between 220 ohm and 1k is better.