If your loading a program for a arduino without the bootloader you have to set the chips fuses you cant be setting them..
Show the code you loaded.
I have to say that you lost me with this whole setting the fuses deal here.
The code is the basic "blink" that is included with the Arduino IDE. That's right, it's that code that is NOT modified in any way whatsoever. I did change the LED pin for my custom board (I have LEDs on pins 2 and 3) but when that didn't work I tried the default setup on a breadboard and unmodified "blink" and it doesn't blink.
So, the code is what is included with IDE.
This is one of the best guides I have found on building a board-duino:
This is exactly what I did. The only difference is that I didn't use an UNO. I only have this Arduino board that I got from a friend of mine. He said that it is a super-duper-mega version of Arduino... or something like that. Like I said, I don't know much about Arduino boards in general
After an Atmega328P is programmed to use a crystal, you must have a crystal in the circuit before you can reprogram anything. Some ArduinoISP circuits and sketches bring out a "clock" line to allow you to program without using a crystal oscillator.
I don't see a problem with the clock in my case. As stated before, I have tried setting internal oscillator and external one with a crystal. I did try different chips and different crystals. Besides, there is no problem with "talking" to the chip. I can ALWAYS read the contents, check and program the fuses, I can verify the data on the chip. It works just fine.
From the behavior that I observe I was under the impression that I'm missing something somewhere that tells the chip to execute the code. It's as if its just sitting there doing nothing because it doesn't know it was suppose to run the code I just uploaded. Or, I thought it's just stuck in some programming mode because I can always talk to it again with the programmer or that Arduino board that I have.
If you are going to do anything in quantity, you are going to have to have a ZIF socket programmer.
I have incorporated a programming port on my board and was hoping I could use that. This way I could simply assemble all the boards including the AVR and then simply connect the programmer, click on "burn" and be done with it. It works great with the non-Arduino hex file that I have. I just plug the programmer in, click on "burn" and after a few seconds my on-board LEDs go through a test routine. I then unplug the programmer, connect external power source and it works.
Hint: buy a "real" arduino UNO to mate this board on so that you have a relatively "clean" programming environment for a reference build.
That is a good advice. I'm starting to think that this super-duper board that my friend got (and let me use one of them), might the culprit. On the other hand I did try an external programming board and it didn't work either.
I guess I'll start over by getting a real UNO and see what happens then.
I think you really ought to rethink the 328 Pro Mini from China. [...]
... unless you plan to contract your own off-shore manufacture for the entire device. Lots of companies use pre-made modules on another circuit board... either with direct soldering of the modules on wire standoffs or with pin-headers for easy replacement/upgrade.
I will be making the boards myself. The quantity is not large enough. If I was to make 10.000 units then yes, I would look for someone to take care of the production. With up to 1000 units I will be doing all the work myself. I have all the necessary equipment and experience required. I just need to figure out why Arduino doesn't want to talk to me.
My circuit is going to be used in a car and for that reason I'd like to avoid using external boards. I was going to use a SMD chip to make the board as small as possible and to make it vibration resistant. I was never a fan of using additional boards because of the vibration experienced in a car. I much prefer a single board design.
Thank you for all your help. I will post when I find a solution to my problem.
Thanks Ray and others!