Atmega32U4 3.3v/8MHZ Programming using ISP

hi guys
i am making a project using atmega32U4 so everything is smd and i choose JLCPCB Assembly

in this project the Spi flash chip and display is all 3.3v so i used 3.3v regualted power for MCU so everything is at 3.3v and 8mhz but i wanna burn bootloader and sketch to it but my devices are 3.3v so vcc cannot be 5v which destroy the chip

so how do i program a 3.3v powered board with an isp programmer like arduino and not destroy the chip

how do i program the spi flash chip by pressing a button and turning serial communication on

(deleted)

spycatcher2k:
Use 'voltage level shifting' with either a Chip, or use a resistor divider for the outputs from your programmer, outputs from your project do not require level shifting as 3.3V IS logic high in a 5V circuit. OR buy a 3.3V programmer!

i need a simple voltage divider from 5v to 3.3v and to what pins should i connect it to i have following in my PCB

TX, RX, MOSI, MISO, SCLK, SDA, SCK,

(deleted)

From where are you getting a bootloader for the atmega32U4 compiled for 8MHz operation ?
You may find something here since this product sound similar to what you seem to want to achieve: Pro Micro - 3.3V/8MHz - DEV-12587 - SparkFun Electronics

spycatcher2k:
TX, RX, SDA AND SCK are not on the SPI bus, you need the conversion on MOSI and SCLK.

no i have these pin in my project which even need to have a 3.3v voltage divider so it does not destroy the part with over voltage and have 5v in my whole circuit as main power supply

6v6gt:
From where are you getting a bootloader for the atmega32U4 compiled for 8MHz operation ?
You may find something here since this product sound similar to what you seem to want to achieve: Pro Micro - 3.3V/8MHz - DEV-12587 - SparkFun Electronics

no i just modified the arduino pro micro with 8mhz in the boards.txt hope it works i guess but the code compiles without problems

the sparkfun board is preloaded with bootloader so we need not program it again

Provide a 3.3 V power supply to the target board. Don't power it at 5 V. You can have the programmer board running at 5 V and the target board running at 3.3 V. Just don't connect the Vcc pins between the two boards. You only need to connect the MISO, MOSI, SCK, Reset, and Ground lines between the two boards. Do level shifting on the MOSI and SCK lines so they don't subject the target to 5 V.

pert:
Provide a 3.3 V power supply to the target board. Don't power it at 5 V. You can have the programmer board running at 5 V and the target board running at 3.3 V. Just don't connect the Vcc pins between the two boards. You only need to connect the MISO, MOSI, SCK, Reset, and Ground lines between the two boards. Do level shifting on the MOSI and SCK lines so they don't subject the target to 5 V.

so i need to have two pads on board one is vcc from MCU and the power line just while programming connect vcc of MCU to 5v and MOSI MISO SCK Reset to arduino programming and after done just bridge the pads running 3.3v to MCU

No. You're making this way more complicated than necessary. There's no need to ever power the ATmega32U4 at 5 V. Power it at 3.3 V.

pert:
No. You're making this way more complicated than necessary. There's no need to ever power the ATmega32U4 at 5 V. Power it at 3.3 V.

The datasheet for the ATmega32U4 expresses a different point of view and concerns users who prefer an 8MHz clock.

See chapter 29.6 Maximum speed vs. VCC

Having said that, I have a Freaduino 32U4 which has a switchable 3.3v/5v operation and with a 16MHz crystal and that has not, to my knowledge, failed under 3.3 volt operation.

i am thinking having a pads to program and voltage selection would be great as it would not interrupt the main power and 3.3v devices and make sure the chip programmed properly

pert:
No. You're making this way more complicated than necessary. There's no need to ever power the ATmega32U4 at 5 V. Power it at 3.3 V.

already my designed board is full and small in size so it is a bit difficult to add resistor

6v6gt:
The datasheet for the ATmega32U4 expresses a different point of view and concerns users who prefer an 8MHz clock.

http://ww1.microchip.com/downloads/en/devicedoc/atmel-7766-8-bit-avr-atmega16u4-32u4_datasheet.pdf

See chapter 29.6 Maximum speed vs. VCC

Having said that, I have a Freaduino 32U4 which has a switchable 3.3v/5v operation and with a 16MHz crystal and that has not, to my knowledge, failed under 3.3 volt operation.

i am using 8mhz on 3.3v and can we program on 8mhz sketch at 5v or it needs to 3.3v for prgramming the sketch and everything is at 3.3v