did someone try (or know) if the ArduinoISP can be used in the newest Arduino 33 BLE?
In other words: Can Arduino 33 BLE be used to program a standalone ATmega328p?
We're trying to transition our PCB from 5V to 3.3V and are looking into ways of programming it via ISP at 3.3V.
Unfortunately, the ArduinoISP sketch doesn't compile for the Nano 33 BLE. I'm sure the Nano 33 BLE can be used as an Arduino as ISP programmer, but the bugs in the code (I'm not sure whether the bugs are in the ArduinoISP sketch or the Nano 33 BLE's core library) will need to be fixed first.
Are there components on your PCB that can't tolerate 5 V? Note that just because you're running the ATmega328P at 3.3 V normally, doesn't mean that you can't power it at 5 V during programming.
If it is a situation where components on the PCB would be damaged by exposure to 5 V, you still use a 5 V board as Arduino as ISP if you add level shifting circuitry to the MOSI and SCK lines. I'm not sure whether it's needed on the reset line. My reading of the datasheet indicates the answer is yes, but I know the reset pin can withstand higher voltages than the other pins.
Thanks for your answer, pert. Yes, there are components on the PCB that can't tolerate 5V.
Although a little off-topic, these are the options I thought of:
Use a 3.3V programmer (Arduino, or other).
As you said, ArduinoISP does not compile for Arduino 33 BLE, but it does for Arduino Due, which is also 3.3V. It is mentioned in this table from the Arduino ISP tutorial, so I guess someone's tried it already
Power PCB with 3.3V and level-shift UNO's data lines to 3.3V
Any recommendation on devices to use for such purpose?
Use a transistor to isolate non-5V tolerant devices when power comes from ICSP pin
Power non-5V-tolerant devices from a power path isolated from that of the one the ATmega is powered from
I am leaning towards option 1 or 2, but I wanted to leave my thoughts here just in case they become useful to someone.
rea104:
ArduinoISP does not compile for Arduino 33 BLE, but it does for Arduino Due, which is also 3.3V.
Same for the Arduino SAMD boards (e.g., MKR Zero) and ESP8266, both of which I've successfully used as Arduino as ISP.
rea104:
Power PCB with 3.3V and level-shift UNO's data lines to 3.3V
Any recommendation on devices to use for such purpose?
I've successfully used the common level shifter modules you can get from most suppliers of electronics supplies, for example: https://www.ebay.com/itm/312917950893
As for options 3 and 4, I would lean toward just getting a 3.3 V programmer set up. Some of the more high end programmers sense the target voltage and automatically adjust their logic levels accordingly. The AVRISP mkII is one such programmer. The original Atmel version is retired, but you can still get clones. The only slightly annoying thing about these programmers is that you need to power the target separately. For this reason, I almost never use my AVRISP mkII. But I also haven't had a situation where I couldn't power the target board at 5 V.
My favorite programmer is the USBasp, which you can buy on eBay, etc. for around $3 USD w/ free shipping from China. They do have a version of the USBasp with a jumper to select between 5 V and 3.3 V. But that jumper only controls the voltage on Vcc. The logic levels are still 5 V even with the jumper set to 3.3 V. Having the target AVR powered at 3.3 V, but subjected to 5 V signals exceeds the specifications.
pert:
They do have a version of the USBasp with a jumper to select between 5 V and 3.3 V. But that jumper only controls the voltage on Vcc. The logic levels are still 5 V even with the jumper set to 3.3 V. Having the target AVR powered at 3.3 V, but subjected to 5 V signals exceeds the specifications.
They generally have a resistor in series with the I/O lines too, though, such that one can usually get away with it.