Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20562

BASCOM-AVR : LDC1000 : REPLY

$
0
0
Try adding MSbit of 1 to proximity address for a read operation: Ad=&HA1 My solution: [code:1:9d975b6f90]$regfile = "m168def.dat" $crystal = 8000000 Enable Interrupts Config Spi = Hard , Interrupt = Off , Data_order = Msb , Master = Yes , Polarity = High , Phase = 1 , Clockrate = 16 , Noss = 1 Spiinit Config Pinb.2 = Output 'manually control ss pin Ss Alias Portb.2 Set Ss Dim Prox(2) As Byte 'data read in Dim Plsb As Byte 'Proximity LSB Address Dim Pmsb As Byte 'Proximity MSB Address Plsb = &HA1 '&h21 plus MSb = 1 for read Pmsb = &HA2 '&h22 plus MSb = 1 for read Dim Proximity As Word 'combined proximity data Reset Ss Spiout Plsb , 1 Spiin Prox(1) , 1 Set Ss Reset Ss Spiout Pmsb , 1 Spiin Prox(2) , 1 Set Ss Proximity = Makeint(prox(1) , Prox(2)) Print Proximity [/code:1:9d975b6f90]

Viewing all articles
Browse latest Browse all 20562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>