Attiny1614 Serial. print

Hi,
I'm trying to get Serial.print to work with the ATTINY1614. I'm using megatinycore and jtag2updi to program the board with arduino. Code seems to be uploading to the board but I cant seem to figure out why serial.print isn't working

It works for me!

How do you have it connected? Did you remember Serial.begin()? (I can't even tell you how much time I've wasted because of that)

You should have TX of your serial adapter connected to PB1 (Arduino pin 5, physical pin 7 - same side as Vcc, but opposite end of the row of pins), RX of serial adapter connected to PB0 (Arduino pin 4, physical pin 6), and ground of serial adapter connected to ground of ATtiny1614...

Recommended way to communicate wiring if you don't have a schematic drawn up, is to hand-draw a wiring diagram and photograph it with your cellphone (much better than fritzing - because nobody ever has fritzing libraries for every part, they substitute things, but people see the diagram and respond just to that, and say they're using the wrong part, and the whole thing spirals downwards)

DrAzzy:
It works for me!

How do you have it connected? Did you remember Serial.begin()? (I can't even tell you how much time I've wasted because of that)

You should have TX of your serial adapter connected to PB1 (Arduino pin 5, physical pin 7 - same side as Vcc, but opposite end of the row of pins), RX of serial adapter connected to PB0 (Arduino pin 4, physical pin 6), and ground of serial adapter connected to ground of ATtiny1614...

Recommended way to communicate wiring if you don't have a schematic drawn up, is to hand-draw a wiring diagram and photograph it with your cellphone (much better than fritzing - because nobody ever has fritzing libraries for every part, they substitute things, but people see the diagram and respond just to that, and say they're using the wrong part, and the whole thing spirals downwards)

I have the same problem, but it's the first time I'm using a serial adapter, I got a FTDI232, I installed the drivers and I can see its port on the arduino IDE, but all I get it's "avrdude: jtagmkII_getsync(): sign-on command: status -1".
My goal atm it's just printing something on the serial monitor.

That error message has nothing to do with Serial.print() - that's an error from the upload or bootloading process. Do you have an Arduino with jtag2updi installed on it connected to the ATtiny1614? You cannot upload via the serial port unless you are using the (optiboot) board definition, and have used a UPDI programmer (like jtag2updi) to install the bootloader. This is all described in the megaTinyCore documentation: GitHub - SpenceKonde/megaTinyCore: Arduino core for the tinyAVR 0/1/2-series - this is any ATtiny part where hundreds and thousands place is 2 or more (flash size in kb), the ones place is a 2, 4, 6, or 7 (8. 14. 20 or 24 pins) and the tens place is a 0, 1, or 2 (featureset)/

A jtag2updi programmer can be made with an Arduino Nano, Uno, or Pro Mini with just a few wires and resistors, see megaTinyCore/MakeUPDIProgrammer.md at master · SpenceKonde/megaTinyCore · GitHub

DrAzzy:
That error message has nothing to do with Serial.print() - that's an error from the upload or bootloading process. Do you have an Arduino with jtag2updi installed on it connected to the ATtiny1614?

I know that and yes I have an Arduino Uno with jtag2updi connected to the ATtiny1614.

DrAzzy:
You cannot upload via the serial port unless you are using the (optiboot) board definition, and have used a UPDI programmer (like jtag2updi) to install the bootloader.

I know know, but I don't have an optiboot.

I successfully loaded basic sketches like the blink, following this tutorial Programming the new ATtiny from Arduino using UPDI [Beginner Tutorial] - YouTube I need to print something on the serial monitor and I found out I can use a serial adapter, but I don't know how to use it and I can't find a simple guide about it.

("don't have an optiboot"? Its software, and included with megaTinyCore! That said, I can't recommend using Optiboot on the tinyAVR 0/1-series parts (the ones supported by megaTinyCore) - it was added as a checkmark-in-the-box, but the Optiboot user experience without a dedicated hardware reset pin kind of sucks, (Okay, not kind of, it does suck) but changing the UPDI pin to reset to get that also disables normal UPDI uploads).

Okay, so you've got jtag2updi programming working? Great. Connect the serial adapter to the board (gnd to gnd, TX to RX, RX to TX; see the pinout charts included with megaTinyCore for which pins are TX and RX on the ATtiny) upload your sketch normally (with the serial port of the jtag2updi programmer selected), then select the serial port of the FTDI adapter and open serial monitor. Don't forget that opening the serial port won't automatically reset the board like it does on a normal Arduino - so if it only generates output right at the beginning, you will miss it.

What I usually do is, instead of using the Arduino serial monitor (which is a piss poor excuse for a serial console anyway), is use some other serial console (hTerm is my choice - it's got every option one could ever want from a serial console and then some - but it's not the most user-friendly one around), and choose the FTDI adapter in that one, connect to it and leave the connection open - then program via jtag2updi. That way you see the output from the program running from the start, and you don't have to keep changing the serial port in the Arduino IDE.

Final aside: I recommend getting a cheap arduino nano clone and dedicating it to use as a UPDI programmer, see megaTinyCore/MakeUPDIProgrammer.md at master · SpenceKonde/megaTinyCore · GitHub They're under $5/ea shipped, and having something that I know is configured as a programmer and has the wiring correct is easily worth it.