Programming of Custom Arduino Board

All, I see the attached board and schematic for info. My plan is to get the boards made, bootload using the ISP pin out and then program via a usb to serial adapter for the arduino mini. Is this reasonable and am I missing anything to make this happen? Previously I did a similar board and was trying to straight ISP with AVR studio from a .hex file generated from arduino. I could never get that to work, and one of the problems I had was that I could never get the fuse bits set correctly. Does installing the bootloader set the necessary fuse bits?

In summary my questions:
1 . is there anything more involved with doing this than hooking up to ISP with an MKII programmer, opening arduino and telling it to install a bootloader, then hooking it up to the usb to serial board and telling it to upload my sketch?
2. Does anyone see any problems with either my schematic or .brd. the board passed iteadstudio's drc.

The board is supposed to look exactly like a pro mini to the computer.

All the board is doing is turning a solenoid valve on and off at a dwell and frequency controlled by two potentiometers.

New_Control_Board_ISP.sch (119 KB)

New_Control_Board_ISP.brd (79.2 KB)

One last question which I forgot. If I don't need the precision of the external clock, can I just remove that and then bootload it with the lilypad bootloader?

This may help: Gammon Forum : Electronics : Microprocessors : How to make an Arduino-compatible minimal board

You don't really need the external crystal if high-precision timing isn't important.

If you don't need good timing accuracy then you can use the internal RC oscillator. However, serial I/O may not work because the clock frequency may be too far out. So you will need to program using ICSP. Doing this is not difficult, I do it all the time. Given that you already have AVR Studio and AVRISP MkII, programming the fuses will be very easy indeed.

Thanks so much for the replies. So I have removed the crystal. It seems to me that I should at this point be able to prgram it as if it were a lilypad. I can load the lilypad bootloader via isp, then program with arduino ide. I believe the serial speed is low enough to reliably work with the internal oscillator doing it that way, correct?

I am still looking for validation that there aren't any hidden steps, extra things I need to add to perform this operation. I can see no reason there should be, but I am very new at this. Also, how hard is it to pull a program I've written in arduino into avr studio? I did not have ANY success generating a hex file and then trying to do that last time so I want to stay away from that. If I am going to program with AVR I would like to just write the program from scratch in AVR. Thank you!

When I program an 8 MHz Atmega328 I choose Lilypad.

I don't recall any problems with serial, you have around 9% leeway with the speed.

wolverineairsoft:
I believe the serial speed is low enough to reliably work with the internal oscillator doing it that way, correct?

Not necessarily.

It's more like +/-4% (which is also what the RS232 specification says). Assuming 1 start bit + 8 data bits, there are 9.5 bit times from when the receiver detects the stat of the start bit, to the time when the receiver samples the middle of the stop bit. The clock must be within +/-0.5 bit times at that point. So the allowable error would appear to be +/-0.5 in 9.5, which is +/-5.3%. However, there are a couple of factors that make it lower than this. First, the receiver UART clock normally runs at 16 times the bit rate, so the start bit may be detected up to 1/16 of a bit time late. Second, at higher baud rates, capacitance in the cable will slow down the rise and fall times.

I still think it is much simpler to program the chip via ICSP, especially as you already have an ISP.

Er, by the tenth bit, you still need to be sampling inside that 10th bit, and not the 9th or 11th, so doesn't that give you a leeway of 1 in 10?

No, it gives you a leeway of +/- 1 in 20. You want to sample the 10th bit in the centre of the bit ideally, but you can get away with sampling near the start or end of the bit. So you have a leeway of nearly half a bit in each direction.

Ach, I see what you mean! Since we are already half-way through the first bit, we can only afford to be out by 1/10 of half a bit.

I wish I understood what you all were talking about. However my question would be, doesn't lily pad use serial communication to program? If so, then what's the problem if I just bootload this board as a lilypad and then program it accordingly?

You can program it as a Lilypad, sure.