Файл CC2500 SPECTRUM.bas

Материал из roboforum.ru Wiki
Перейти к: навигация, поиск

<source lang="vb">

$prog &HFF , &HAE , &HD7 , &H00 $regfile = "m8def.dat" $crystal = 8000000 $baud = 19200 $hwstack = 64 $swstack = 32

Config Pinc.0 = Output : Led Alias Portc.0 : Led = 1 Config Pinb.1 = Output : Zb_cs Alias Portb.1 : Zb_cs = 1 Config Pind.2 = Input : Gdo2 Alias Pind.2 Config Pind.3 = Input : Gdo0 Alias Pind.3 Config Pinb.5 = Output : Zb_sck Alias Portb.5 : Zb_sck = 0 Config Pinb.4 = Input : Zb_miso Alias Pinb.4 Config Pinb.3 = Output : Zb_mosi Alias Portb.3 : Zb_mosi = 0

Config Spi = Hard , Interrupt = Off , Data Order = Msb , Master = Yes , Clockrate = 128 , Polarity = Low , Phase = 0 Spiinit

Print "START"

$include "settings\MSK500RX.bas" $include "include\cc2500.bas"

On Int1 Gdo0_int1 Config Int1 = Falling Enable Int1 Disable Interrupts

Dim I As Byte

Call Cc_spi_read_register_burst(ccxxx0_patable , 8) Print "PATable : " ; For I = 1 To 8

  Print Hex(cc_recv_buffer(i)) ; " " ;

Next I Print Call Cc_spi_send_strobe(ccxxx0_srx)

Do

Loop

Gdo0_int1:

  Disable Interrupts
  Enable Interrupts

Return


</source>