Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/18/03 12:54
Read: times


 
#58886 - at89s8252 and ADS1286 with SPI

Hello,I will read(at89s8252) two bytes(16 bits) from ADC1286 - SPI.First
as MSB,secondary as LSB.
my program:
.
.
.
SETB P1.5
SETB P1.6
SETB P1.7
MOV SPCR,#01011111B ;config SPI
SETB P1.4
CLR P1.4
MOV R2,#02h ;two bytes to read
START: SPDR,#01h ;start SPI :write byte to SPDR

CHECK: MOV A,SPDR
ANL A,SPSR ;status register:check SPIF
JZ CHECK

DJNZ R2,MSB_SPI ;if R2<>then byte=MSB->R6,if R2=0 then byte=LSB->R7
MOV R7,SPDR
AJMP SHIFT_TWO

MSB_SPI:MOV R6,SPDR
AJMP START
.
.
.
SHIFT_TWO:
.
.
.
Is this realy good?I cann't newer read LSB as FF.-> input +V=Vref (max.=(MSB*256)+LSB=BF4E)

Darek


List of 3 messages in thread
TopicAuthorDate
at89s8252 and ADS1286 with SPI            01/01/70 00:00      
   RE: at89s8252 and ADS1286 with SPI            01/01/70 00:00      
      RE: at89s8252 and ADS1286 with SPI            01/01/70 00:00      

Back to Subject List