Gast
#885222
Hi leute.ich habe gerade ein Problem mit meiner Chip-select Leitung.
Diese wurde am PORT PA4 abgegriffen
Diese regiert einfach nicht
bei der SPI Einstellung ist das CS leitung HI
und bei der DA Wandlung ist diese am anfang High active um daten
anzunehmen und am ende der Wandlung wieder Low Active
; Set CS Low
CSLOW BCLR PORTA,X, CS ; Pull down chip select HI
RTS
; Set CS HIGH
CSHIGH BSET PORTA,X, CS ; Pull Up chip
select--->High
RTS
Hier ist das Programm für die DA wandlung
OUTBYTE LDX PORTA
JSR CSLOW
LDAA SDATA ; Load A with what's in
SDATA
STAA SPDR,X ; Send Byte OUT to the SPI
Wait1 BRCLR SPSR,X $80 Wait1 ; wait for the Byte to be
sent
LDAA SPDR,X ; read Byte back into ACCA
STAA RDATA ; Store the read In location
STAB SPDR
Wait2 BRCLR SPSR,X $80 Wait2 ; wait for the Byte to be
sent
JSR CSHIGH
RTS ; return to Sbubroutine
Wo könnte das Problem liegen