Attiny3217 - generate serial data on every GPIO

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0



This code I've written is intended to test a breakout board. It generates 9600baud serial output on every GPIO pin* with a short repeated message identifying the output pin.


The idea is, to probe every pin of the test board to check that the signal is as expected, with a scope (which can decode serial) or just a serial dongle and some breadboard wires, etc, to be sure that everything is wired right.


It is written to use my own toolchain, which is very similar to Vlad Belous toolchain, but also very similar to the one which Atmel Studio uses, so I expect it will compile on any of them.


It can be fairly trivially modified for different MCUs in the same family (probably works unmodified on many), although I have only tried it on the 3217.


These microcontrollers cannot make arbitrary assigments to outputs of peripheral devices, so my code uses bit-banging to output serial data on every port *except* the one port which has a hardware UART output by default.


I hope this is useful for somebody.


* Except the gpio port which is shared with the programming pin, UPDI