Smoked a chip. Trying to narrow possibilities. SERIAL_TX_ONLY? Pull down resistors? Library? #917
-
FTR, most of what I'm using is something that worked flawlessly on Arduino Nano. Both the hardware configuration and the code. Trying to figure out what went wrong. Programmer is an adafruit FTDI friend, FT232RL, running at 3.3V, and a schottky diode from RX to TX. Dev board is a LeoNerd ATtiny1616. The only connections from the FT232 to the tiny are UPDI and Gnd. Vcc is NOT connected. Board is running off of a bench supply, running at 2.8V I got the "hello world" code to compile and upload successfully (optimized for size, for now), and then moved on to the next step. When I uploaded the new code (I can't remember if I pushed a button or not), the bench power supply jumped from ~4-6mA, up to 450mA, at 2.8V. I knew something was wrong, but I didn't know WHAT. When I connected serial, the chip was still outputting, but the data was slightly corrupted. I tried uploading the old code. No Joy. Tried burning bootloader. No communication. When I put serial back on, the corruption was getting worse (not shocking). The chip is functionally dead, and I'm still waiting on the spares that I ordered. Trying to figure out what went wrong, in the mean time. Here's the code I uploaded.
When using USART, on a Tiny1616, I'm wanting to run serial as TX only, to save pins. Do I need to call "SERIAL_HALF_DUPLEX", or can I call just "SERIAL_TX_ONLY", and still use the pin that USED to be RX, for an input? I'm wanting to attach a button to PA2, for the interrupt function (also putting a button on PA6, for the same purpose). The buttons are SPST-NO, connected straight to ground. On arduino, this worked fine, once I debugged the button.h library. Here's the amended library. #ifndef button_h
#define button_h
#include "Arduino.h"
class Button
{
private:
uint8_t btn;
uint16_t state;
bool metastate;
public:
void begin(uint8_t button) {
btn = button;
state = 0;
metastate = false;
pinMode(btn, INPUT_PULLUP);
}
bool debounce() {
state = (state<<1) | digitalRead(btn) | 0xfe00;
if (state == 0xffff){
metastate = false;
}
if (state == 0xfe00){
metastate = true;
}
return (metastate);
}
};
#endif Currently, all pins other than PA0, PA1 (serial TX), PA2 (button, to ground), PA6 (same as PA2), and PA7 (LED to ground, through 2.2k) are floating. Any ideas what I did to kill the poor chip? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Whaaatzeeefawwwkkkkkk I do not know what you did to kill the chip,. If it was triggered by software, in involved external hardware doing something unholy. Unless you somehow managed to find a literal halt and catch fire function. 450ma and smoke says to me "voltages outside the supply rails are involved". Was there something that was As for serial configuration, you want SERIAL_TX_ONLY. You don't want half duplex. You said you want to transmit only. There's nothing duplex about it - it only lets the signal go in one direction. Half duplex lets data go in both directions but not at the same time and full duplex lets data both both directions at the same time I will clarify that Serial TX only should not be combined with SERIAL_HALF_DUPLEX or whatever I named the option that controls the LBME bit. TX only will leave the receiver off. The pin can be used for other purposes. So that's how you get half duplex - with ODME you never drive the pin high, an just have the internal pullups on on both sides, and maybe external pullups depending on speed, wirelength and other factors, and multiple devices can each be connected to the same lwire and drive it low or leave it be. And loopback mode, while one effect is that you "receive" every character you transmit, it also means that if the pin is in open drain mode and something else is driving it low in a pattern consistent with serial, you'll receive that too. When in half-duplex (ODME + LBME) In all cases, When something it printed or written to serial, at that point only do we clear the TXC flag - and if we're in half duplex mode, we also reenable the TXC interrupt. SERIAL_TX_ONLY and HALF_DUPLEX (specifically the LBME part) make no sense. because. It... reroutes the TX signal to RX, but it falls on deaf ears because receive is turned off. so why bother?) And if you want ODME, just ask for that. For transmitting only, SERIAL_TX_ONLY should be all you need. |
Beta Was this translation helpful? Give feedback.
-
when the chip started smoking, was it still connected to the FTDI chip? |
Beta Was this translation helpful? Give feedback.
-
I'm still not sure what the cause was, but I added the resistors, and haven't had an issue, since. We'll call it that, for now. Thank you all! |
Beta Was this translation helpful? Give feedback.
when the chip started smoking, was it still connected to the FTDI chip?
I have the feeling that the higher Voltage of the FTDI (3.3V - 2.8V) might have lead to the problem. It seems like an ESD diode on a pin shorted, as the CPU was still running.
Sure, the datasheet says the pin can handle up to 13V for a UPDI reset, but it was desgned for pulses, not for a continous load.
There was no mention of a resistor on the UPDI line. Do you have one between the Serial adapter and the Tiny?