MBelow is a simple T85 assembler program to raise Pin3 (PB3). Looking at pin3 with a logic analyser I see a square wave signal switching at around 8uS period. If I change the program to force pin3 low, it goes low as expected. I replaced the assembler with a simple (Arduino) C program and that works as expected. Why am I seeing a switching waveform is it something to do with the way my main loop is executing? Spent most of the day trying to track this down so have tried may things on the way and the code below is now reduced from it's original down to the bare bones. It looks as though setting the pin when it is already set causes it to reset in some way.
.INCLUDE "tn85def.inc" ; Port definitions .LIST ; Output to list file on .CSEG .ORG 0 rjmp Init .ORG 52 ; ; Define Registers ; .def TEMP = R16 ; .equ LED = PB3 .equ CS = PB4 ; Program start ; Init: ;set pin directions sbi DDRB,LED ; output cbi DDRB,CS ;input sbi PORTB,CS; set pull-up ; Program loop ; Loop: sbi PINB,LED rjmp Loop ; ; End