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

BASCOM-AVR Old versions : Interfacing Atmega8 with ADE7758 : REPLY

$
0
0
Try something like this: [code:1:ba9dbdfb68] 'Your code Ss Alias Portb.2 Config SS = Output 'SS Set SS Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Polarity = Low , Phase = 1 , Clockrate = 4 , Noss = 1 'remove SPIIN = 255 Spiinit 'Your code Do Cls Reset Ss Spiout Wrt_adrs , 1 Spiout Address , 1 Spiin Readdata , 1 'You will need to modify this to read a 2 byte array; eg: SPIIN Readdata(1), 2 or DIM as Word Set Ss Lcd "Value = " ; Hex(readdata) Locate 2 , 1 : Lcd I ; " Loops" Wait 1 I = I + 1 Waitms 200 Loop End[/code:1:ba9dbdfb68]

Viewing all articles
Browse latest Browse all 20563

Trending Articles



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