Grad noch mal mit Bascom rumgespielt:

Do
Pulseout Portb , 1 , 50
Waitus 11
Loop

erzeugt auch ne 40Khz Frequenz