Disable TX on Arduino after uploading to ATTiny? #1282
Replies: 3 comments
|
The only way I was able to program and print via the same com port was with a serial adapter that has DTR broken out and a few components https://forum.arduino.cc/t/yet-another-updi-programmer-mk-ii/1357056/2?u=hmeijdam |
|
Let me add my 2 cents: I would suggest buying a Curiosity Nano Attiny 3227 board. This is a 3226 with a few more pins. And the board contains a programmer/debugger that gives you just the functionality of uploading sketches and using a serial interface over the USB connection. The board costs around €10 when you buy it from Microchip or DigiKey. Probably a bit more from local distributors. In addition, you can use it to debug your sketch symbolically with Microchip IDEs or even with the Arduino IDE 2 when you install PyAvrOCD. Note that you can use the CNANO board as a stand-alone programmer/debugger for other UPDI targets as well. (Full disclosure: I am the author of PyAvrOCD, and I am not affiliated with Microchip in any way) |
|
Thanks for the responses. But sorry Felias, I don't think getting an extra device would help. Hmeijdam, I did a general web search before posting to this board, and it did find that same thread on the Arduino forum! I didn't read it very carefully, but I'll go back and look again. |
Uh oh!
There was an error while loading. Please reload this page.
I'm playing around with an ATTiny3226 and loading code to it via megaTinyCore on an Arduino Nano. It works correctly, and I appreciate getting it. There's a feature which I'd find useful, but if it's already in mTC I don't know how to find it. What I want to do is communicate with the ATTiny via the Arduino IDE's monitor, as I could easily do on an ordinary Arduino. And I want to do it with the same USB port that I connected for loading the code! It's a great convenience to be able to load code and then communicate with the processor immediately afterward, or especially get text printouts showing what's happening when it runs. It would be possible to do this by linking RX on the ATTiny with RX on the Arduino, and likewise TX. The problem is that when mTC has loaded code to the ATTiny, it keeps the serial port active, so I can't put the ATTiny's TX in parallel. What I did try experimentally was putting the Arduino in permanent reset by grounding the reset pin after loading the program, and then it worked, because the Arduino port pins all went into high-impedance mode. But then I have to let the Arduino run in order to reprogram the ATTiny. I could wire up a switch to do this manually, but I'd prefer not to have "program" and "run" modes.
I've looked at the data sheet for the Atmega328, and they say "TXENn: Transmitter Enable n... When disabled, the transmitter will no longer override the TxDn port." So that seems to mean that it would be possible to control the state of the TX pin while leaving RX still active. I'm wondering, can mTC do this already, and if not, could the feature be added?
There's already a visible complication. If the Arduino TX is disabled, what happens when the computer starts a new download operation? The Arduino would have no ability to talk to the computer. But maybe this isn't a major issue, if the Arduino recognizes that a download is being started, and operates the UPDI line so as to make the ATTiny's pins go into high-impedance mode, and once that's done, enable its own TX pin.
I'm writing this as a user and not as a person who really understands how megaTinyCore works! So maybe this has already been implemented, and maybe it can't be done. But I'd certainly use the feature if I had it.
All reactions