USBasp programmer for 28 pin DIL

Hello

I bought a 3.3v Pro Mini, and a USBasp programmer cable.
All well there... installed it into the IDE and I can program the 3.3v Mini fine.

I also have here some ATMega328p 28 pin DIL IC's. No idea when I got them, but they are new.

I found the attached image on Google, and have been playing, but cannot get it to upload with the USBasp (Processor set to ATMega328p, 3.3v. 8Mhz - upload using programmer).

My questions therefore...

1/ Is this chip programmable at 3.3v? Can't see why not, but I may be wrong
2/ Does it need the external crystal (8Mhz) attached, or should it upload without it?
3/ What am I missing? Clearly something

Many thanks

ATMega328 - connections.jpg

IanStMartin's picture:
2aa90318775e1864b2ce04408a6d96928f9e01ad.jpg

IanStMartin:
1/ Is this chip programmable at 3.3v? Can't see why not, but I may be wrong

Yes.

IanStMartin:
2/ Does it need the external crystal (8Mhz) attached, or should it upload without it?

It depends on whether the fuses have been configured to require an external clock source. If so, then you won't be able to do anything with the chip until you provide a clock source, even if you only connect it just long enough to set the fuses to use the internal oscillator. The factory default fuse setting is to use the internal oscillator. However, if you buy chips "with Arduino bootloader", they will be set to use an external clock since they are expected to be put in an Uno.

IanStMartin:
cannot get it to upload with the USBasp (Processor set to ATMega328p, 3.3v. 8Mhz - upload using programmer).

Note that you need to use a Tools > Board selection in the Arduino IDE that is configured for the internal oscillator and then do a Tools > Burn Bootloader to set the fuses correctly. The Pro Mini uses an external oscillator so you can't use that board definition. I recommend using MiniCore, which does have an internal clock selection (Tools > Clock > 8 MHz internal):

IanStMartin:
3/ What am I missing? Clearly something

You should make a connection to the other ground pin.

You should make a connection between the two power rails on your breadboard.

You should have a 0.1 uF decoupling capacitor on both power lines into the chip, as close to the chip as possible.

Like this:

That image is from Nick Gammon's excellent tutorial:

Thanks Pert.

I installed the MiniCore board tools

I did have the board wired correctly (all 0v's and +3.3v to correct pins + 0.1uf caps). The image was just to show the Mosi/Miso/Clk connections.

Took some playing around, but finally got it to upload code using external 8Mhz crystal (just would not do internal).

My next question, seeing as Google failed to provide anything I could understand!...

Is there any way of using serial monitor with the USBasp? I would like to Serial.print my variables for testing to the serial monitor the same way I do when using an Uno or Mega.

If not through the USBasp, then some other way?

I'm glad to hear it's working now.

Regarding your question about the USBasp: Some 10 pin USBasps (not all) have the serial lines connected to pins 4 (RX) and 6 (TX) on the ICSP cable to permit this functionality:


There is a custom USBasp firmware that allows the use of this functionality:
https://community.atmel.com/projects/usbasp-tty-usbasp-programmer-modified-serial-support-and-terminal-program

I've never tried it, but it would be nice.

Many thanks Pert.

I am away tomorrow. I will have a look into this when I am home.
Never thought to check the 10 pin connector on the USBasp. I am connected to the 10 pin socket with the 6 pin adapter that came with it.

Cheers

That's annoying....

Doesn't look like my USBasp has the RX/TX pins wired.

Not sure I am competent enough to flash the USBasp.

Is there any way I could take the RX/TX pins of my ATMega328p and fire them through a spare UNO RX/TX and obtain the data that way?
I have an Uno set up as a programmer here.

IanStMartin:
Is there any way I could take the RX/TX pins of my ATMega328p and fire them through a spare UNO RX/TX and obtain the data that way?

Yes, you can do that. Usually how people do this is to upload a BareMinimum sketch to the Uno so that the primary microcontroller won't interfere with communication. Then you need to make the connections between your ATmega328P and the Uno RX-RX, TX-TX. That seems wrong, but what you're actually doing is communicating directly between the ATmega328P and the USB to serial chip on the Uno. Since that USB to serial chip is connected to the Uno's ATmega328P RX-TX, TX-RX, when you connect to the Uno RX-RX, TX-TX you're actually making an RX-TX, TX-RX connection to the USB to serial chip.

Much less confusing is to get a dedicated USB to serial adapter. They are very cheap, readily available from the usual sources, and a handy tool to have.

Thank you for all your advice Pert.
I will have a play around tomorrow once the living room decorating is done!