Code: Select all
org 32768
di
ld a,0
ld b,0x10
loop:
xor b ; 4T
out (0xfe),a ; 11T
jp loop ; 10T (jr is 12T)
The loop is 25Ts, so 3,500,000/25 is 140,000. It takes 2 loops to toggle the bit and make a click, so this sends out a whine at 70kHz. Only, that's way above the limit of human hearing, and I can still hear it, which means there's a flaw in my logic somewhere. Where's my error?
I don't have real hardware and I'm using Fuse, which may or may not have something to do with it.