ATTINY88 28VQFN Can't Get SoftwareSerial to Work

I am using an ATTINY88 Core with no bootloader on a custom board.

I am trying to troubleshoot my actual code but can't get a serial port to work so I took a step back and tried the TemperatureRead example with a few modifications for SoftwareSerial and blinking a Yellow LED. The Yellow LED blinks but I still can't get Serial to work.

/* This example demonstrates use of the internal temperature sensor.
|  Be sure to read the datasheet, particularly the part about how
\  the sensor is basically uncalibrated. */
#include "SoftwareSerial.h"

#define rxPin       7
#define txPin       6
#define YELLED      9

SoftwareSerial mySerial(rxPin, txPin);

void setup(){
  analogReference(INTERNAL); //You must use the internal 1.1v bandgap reference when measuring temperature
  mySerial.begin(9600);
  pinMode(YELLED, OUTPUT);      //Yellow LED pin is output
  digitalWrite(YELLED, HIGH);   //Turn Yellow LED OFF
}

void loop() {
  int temperature=analogRead(ADC_TEMPERATURE); //ADC_TEMPERATURE is #defined to be the channel for reading the temperature; this varies between parts.
  mySerial.print("ADC: ");
  mySerial.println(temperature);
  digitalWrite(YELLED, !digitalRead(YELLED));   //Turn Yellow LED ON/OFF
  delay(500);
}

I am using a standard FTDI TTL-232R-3V3 smart cable for my serial port to a TeraTerm console.

Any ideas why I can't seem to get serial to work on my ATTINY88?

Is there any character, "art", garb,.... coming up in the serial monitor?
The same baud rate, 9600, set in serial monitor?
Your schematics is a little bit shorted, connections cut off....

There is nothing coming out on the serial console at all.

I am setup with 9600 Baud on TeraTerm.

I have even tried swapping rx/tx assignments and still nothing.

As for my schematic, I thought I would only snip the important parts: the ATTINY88, the Yellow LED and the serial port. I don't think anything else on the board really matters to get my serial port to work.

Your schematic and code appear correct. So I would suspect you don't have terraterm configured correctly.

Here is my TeraTerm:

TeraTerm Snip

I've made sure COM12 is the one connected to my board too.

This should work and I'm slamming my head against my desk because I must be missing something.

Okey, not as much as poo from a fly.
Okey, baud rate checked and set.

Trial and error is not recommended. The wrong way, Tx to Tx might stress certain components. Never mind but don't do it again.

Well. At this stage of our fault finding nothing can be disregarded, as I feel.
Tx and Rx.... Yes. GND also?

Do You have access to an oscilloscope? If so, have You monitored the Tx, and Rx?

More. Can You temporarily use a common serial monitor and serial.print for debugging? Test texts like "Reading temp.", "Temp received", "Calling printing myserial", "myserial.print done" etc.

The code looks all okey so the fault looks like a ghost so far.

The only thing left is the FTDI cable.

Attinycore has a built in softwareserial named Serial, that is using the same pins as you use. Maybe give that a try instead of your self included softwareserial library to test if you see some info on your serial monitor

For debugging purposes, you could switch the TX pin to the red LED and see if it blinks when you send data

I'm not entirely following. I believe I am only using one serial.

I hooked up my Analog Discovery and setup for UART protocol at 9.6k baud. I am getting output from TX. I'm not positive on what it should look like but it looks like non-sense to me.
Serial Output

Thank you for that! However, I tried it and it gives me the same output as the SoftwareSerial.

Thank you all for your help so far!

I forgot this in my reply. I looped the RX to the TX on my FTDI cable and it echos back the characters. So I believe my cable is good.

I aim at some way to get serial prints from inside the code showing internal things.
That strategy was a backbone in my work being thrown into large, unknown systems, and it was a great help.

What did You sample there? 2 channels?
Sorry to say but it looks like "something" is going out. No idea what. There's life at least.

I agree on that strategy. That is exactly what I'm trying to do on my actual code but I can't get a serial port to work.

The first line is the ASCII translation of the data shown on the second line that is my TX signal.

It confuses only. Different patterns are "break". Never mind, there's hardware action.

What has happend to the "standard" serial channel? The channel used for downloading code?

It looks like no success reaching the Terminal. Any other way thinkable?
Can You verify, in some way, that the Terminal is properly configured and okey?

Late here, have to go horizontal.....

Everything that I have found says that the ATTINY88 doesn't have a hardware serial. So I am stuck with a software serial.

For programming, I am using an UNO as ISP and loading over the SPI port.

Ok, I had a light bulb moment and remembered that the different internal clock speeds can be unstable on lower voltage supplies. Given that this seems like a timing problem and I am running at 3.3V, I figured I would play with the internal clock.

I was setting it up to use the 8MHz, changed it to the 4MHz clock and now it puts out valid information on the terminal!

Thank you all!

Well done, really well done! I'm an UNO guy only and would never have guessed that.
Aha, no hardware serial built in.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.