SpenceKonde / ATTinyCore

Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8
Other
1.53k stars 301 forks source link

How do I output the internal clock signal on the CLKO pin #809

Closed ahshah closed 9 months ago

ahshah commented 9 months ago

The datasheet mentions in Section 6.4: Clock Output Buffer The device can output the system clock on the CLKO pin (when not used as XTAL2 pin). To enable the output, the CKOUT Fuse has to be programmed.

Okay so I program the fuse bits as follows: /avrdude -C~/Documents/Arduino/hardware/ATTinyCore/avr/avrdude.conf -v -pattiny85 -cusbtiny -B8 -e -Uefuse:w:0xFE:m -Uhfuse:w:0b11010111:m -Ulfuse:w:0xe2:m

With the lower fuse set to 0xE2 yielding 0b1110 0011 which i think should be read as: CKDIV8: Enabled CKOUT: Enabled SUT1: Enabled SUT0: Disabled CKSEL3: Disabled CKSEL2: Disabled CSKEL1: Enabled CKSEL0:Enabled

This should yield 8mhz on CKOUT- should I then be able to measure the clock signal on the CLKO pin (pin 4)? Do I need any special code to enable the ouptut?

ahshah commented 9 months ago

Moving this to discussions- sorry!