Close

Debug interface

A project log for konijntje-thermo-humi

Gadget that shows room temperature & humidity on a LED-bar

Christoph TackChristoph Tack 06/10/2018 at 12:590 Comments

A simple debug interface is useful in any MCU project.  Unluckily, the ATtiny doesn't provide one by default.  

Serial communication would be most suitable.  This communication however isn't very forgiving about large baudrate offsets.  As we're using the internal oscillator, which has quite some frequency tolerance by default, we should check this.

The program "checkInternalRcOsc" outputs a close to 10KHz waveform on OC0A (pin 5).  Using a frequency counter, we can tune OSCCAL so that the output waveform frequency is closer to 10KHz.

The default frequency on my device was 10.16KHz.  After tuning, it's 10.02KHz.  More than accurate enough for UART communication.

The SoftwareSerial-library can be used to configure the unused pin 10 (PA3) as TX-output.

Discussions