I'm trying to transmit from an ATtiny85 to a PC using Arduino-esque code over a USB-Serial converter without understanding very much of anything. I was shocked and appalled that it did not work.
I confirmed that the tiny is flickering the voltage on one of its pins, but when I connect that pin to transmit or receive on the USB-serial cable and try to listen using a terminal program, I get nothing.
I'm not sure how to tell which part is broken.
Do I need more than VCC, GND, and TXD to transmit serial?
Details:
The code for the tiny is written in the Arduino environment and similar code successfully blinks all 4 "PORTB" pins, at least according to the LEDs. I use the code from HLT and Saporetti to let me use the Arduino dialect of C++ to program it. The program still comes in under a K.
#include <SoftwareSerial.h>
SoftwareSerial s(0,1); //receive on "0", and transmit on "1" aka "PB1" aka pin 6
void setup() { s.begin(4800); } // assuming 1Mhz, 4800 baud
void loop() { s.println(millis()); } // transmit something at every opportunity
There's a lot of translation involved, but the code is pretty basic. The code that sets the baud rate seems to assume 1MHz, but luckily my attiny has factory default fuses and runs at 1MHz. At any rate, pin 6 is flickering its voltage according to the LED.
So I use the little wires to connect the "ftdi" end of the FTDI USB-serial converter to the tiny: black to GND, red to VCC, orange to 6. I open the program "minicom" on the PC, set the baud rate to 4800 and wait, for nothing. When talking to my Boarduino, it has no trouble.
The FTDI converter cable has the following pinout: black is GND, brown is "CTS", red is VCC (+4.98V), orange is "TXD", yellow is "RXD", green is "RTS".
If I want to transmit from the tiny to the PC, should I be flickering the voltage on "TXD" or "RXD"? In other words is the transmit wire to transmit from the slave to the host, or the host to the slave?
I actually tried both, neither worked. I've fried less than a dollar's worth of equipment so far, and I'm getting cocky, so I just plug wires into the cable. Maybe I'm not supposed to ignore the "CTS" and "RTS" wires?
Do I need to use any other wires? Do RTS and CTS do anything?
The hardware is an ATTiny85-PU (DIP-8 package, running at 1MHz, rated to 20MHz) powered by USB at 4.98V. The host PC is a MacBook, and it successfully does all things arduino, including using ArduinoISP to program the ATtiny to blink its little heart out.