ATMega 32u4 & 328P Bootloader/Uploading code

I am trying to make a keyboard with an ATMega 32u4 and an ATMega 328P.

Both of these chips will be the non breadboard type, and I don't know how to burn a boot loader or upload code to them besides hardwiring 2 USB ports to the correct pins.

Please read the first topic telling how to get the best from this forum.
Your question makes no sense. Why two controllers for a keyboard?

the 32u4 sends the keystrokes, and the 328p manages the lights, since the 32u4 doesn't have enough pins

Pull out the ICSP header.
Alternatively, the SPI bus and RESET pin can be used instead.
Pay attention to the connection with other components on the circuit.
ICSPs can also be disrupted by other circuits connected to the SPI bus or insane RESET pull-ups.

I probably will have things connected to the spi bus (not using it, though), and the 328p will be soldered onto a PCB. Could I connect a FTDI breakout to the correct pins?

I can't tell without looking at your PCB schematic.
Also other components connected to the SPI bus whether used or not, have the potential to interfere with the ICSP.

Is it an original PCB? If you have a schematic of the board please post.
Or the model number of the board, and products link.
Or Clear photos of the board (back and front), etc.


I am just starting this project out, which is why there are only the microcontrollers and their "barebones"

This is the basic "barebones" for each microcontroller. The I2c pins on the 328P will be used for a display, and the rest of the pins will be used to control lights. on the 32u4, the pins will be used to receive keyboard inputs and rotary encoder inputs. They are connected via UART to talk to each other and sync the lights to the keystrokes.

Would the UART connection Interfere with the programming of the 328P?

So the bootloader hasn't been burned yet, right?
In that case you need to program with ICSP first.
A corresponding programmer is required to program the bootloader using ICSP from the Arduino IDE.
Do you have anything?

You can also use another Arduino.
Read documents below.
https://www.arduino.cc/en/Tutorial/BuiltInExamples/ArduinoISP

There is no problem because ICSP is done by SPI.
But, after programming the bootloader, it can be a problem when if you upload sketches via the bootloader using USB-UART.

I don't have any parts yet. As I said, I am still just planning out ideas. The microcontrollers will be soldered onto a custom PCB. The spi pins will be used by a matrix. so could I use an FTDI programmer with the 328p?

I should say that I think I could put the breadboard version of the 328p into my PCB, what way I could use another arduino to program it

There is a way to ICSP using FTDI, but Arduino IDE doesn't support it.
The bootloader must already be programmed to program using the UART like a normal Arduino.
So all blank 328P the first program needs ICSP.
As an exception, some chip vendors sell uC with pre-installed user applications but probably only in case purchase many qty.

Follow link at my post above. #10

That would work, I could also use a breadboard 328P instead.

Yeah, give it a try.
And create topic again if you have any problems at program 328P.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.