i’ve been spendng 2 months this semester trying to get the trw-24g to work. i have tried the pic18f242 before, but to operate 40MHz was incompatible with the 3.3v. i also don’t have a voltage leveller. So then i moved on to the scenix SX28AC. since it performs instructions at the same of the 50MHz crystal.(1 instruction per clock cycle, lightning fast).
What i’m trying to do is sample audio at a high speed from a A/D chip and send it wirelessly to a nothe MCU where is will be fed to the D/A.
this is the only module i cannot seem to get working and this is the second batch of trw’s i have ordered. i am running these on a breadboard 2 inches apart. if anyone is able to give a little assistance with this i’d be very greatful.
'
created with SX-Key v3.2
'receiver module
'===============DEVICE=SETTINGS==============================
DEVICE SX28, TURBO, OSCHS
ID RFv1a
IRC_CAL IRC_SLOW
FREQ 50_000_000 '50MHz
'------PIN-ASSIGNMENTS-------
'----------PORTA-------------
DATA1 var ra.2
CLK1 var ra.3
'----------PORTB-------------
DR1 var rb.0
CS var rb.1
CE var rb.2
VCC var rb.3
'----------PORTC-------------
LEDs var rc
'-------VARIABLES------------
RcvDta var byte 'byte to store recieved data
idx var byte 'table index
rfcon var byte 'byte used for configuration
txsend var byte 'stores address bytes of destination module
TXdata var byte
'-------SUBROUTINES----------
Rx_Setup sub 0
Rx_Mode sub 0
'----------------------------
program start
start:
pause 2000
low LEDs
low CE
low CS
high VCC 'Power Up TRW-24g
pause 3 'Tpd2cfgm = 3ms
'------------------------------------------------------------------------
Main:
goto Rx_Setup
goto main
'===============RECEIVE=MODE=CONFIGURATION=================================
Rx_Setup:
high CS 'Enables configuration mode
pauseus 5 'Tcs2data = 5us
pauseus 0.5 'Ts = 500ns
idx = 0
low CLK1 'starts the the clock from the
'idle position of 0
do
read CfgWord + idx,rfcon 'reads the Configuration 14 byte word
shiftout DATA1,CLK1,MSBFIRST,rfcon,11 'this sends out 14 bytes of configuration word
' at a rate of 913 kbps
inc idx
loop until idx = 14
low CS 'Enters Standby Mode and sets the configuration
low DATA1
goto Rx_Mode
'===============RECEIVE=MODE=SUBROUTINE=================================
Rx_Mode:
low CLK1
high CE 'Enables Active Mode
pauseus 200 'Tce2data = 200us
DR_Test:
if DR1 = 0 then DR_Test 'tests for data ready pin
shiftin DATA1,CLK1,MSBPRE,RcvDta\9,11 'clocks in 8 bits since the 1st is neglegible
LEDs = RcvDta 'Outputs data to 8 LEDs
goto Dr_Test
'===============DATA=TABLES============================================
CfgWord: 'the configuration for rx mode
data $08 'Data 1 width = 8bits
data $00 'receive-channel 2 not used
data $00
data $00
data $00
data $00
data $AA 'receice-channel 1 address :AA.BB.CC.DD.EE
data $BB
data $CC
data $DD
data $EE
data $A3 'Address witdh 5 bytes with 16bit CRC
data $6F 'Crystal = 16MHz, Data Rate = 250kpbs, Shockburst Mode & power output = 0dBm
data $15 'RF Channel #10 & Receive mode.
Transmitter code
'created with SX-Key v3.2
'transmitter module
'===============DEVICE=SETTINGS==============================
DEVICE SX28, TURBO, OSCHS
ID RFv1a
IRC_CAL IRC_SLOW
FREQ 50_000_000 '50MHz
'------PIN-ASSIGNMENTS-------
'----------PORTA-------------
DATA1 var ra.2
CLK1 var ra.3
'----------PORTB-------------
DR1 var rb.0
CS var rb.1
CE var rb.2
VCC var rb.3
'----------PORTC-------------
LEDs var rc
'-------VARIABLES------------
idx var byte 'table index
rfcon var byte 'byte used for configuration
txsend var byte 'stores address bytes of destination module
LEDVal var byte 'byte to be sent
TXdata var byte
'-------SUBROUTINES----------
Tx_Setup sub 0
Tx_Mode sub 0
'----------------------------
program start
start:
pause 2000
low LEDs 'LEDs off
low CE
low CS
high VCC 'Power Up TRW-24g
pause 3 'Tpd2cfgm = 3ms
Main:
goto Tx_Setup
goto main
'===============TRANSMIT=MODE=CONFIGURATION===============================
Tx_Setup:
low CLK1
high CS 'Enables configuration mode
pauseus 5 'Tcs2data = 5us
pauseus 0.5 'Ts = 500ns
idx = 0
do
read CfgWord + idx,rfcon 'reads the Configuration 14 byte word
shiftout DATA1,CLK1,MSBFIRST,rfcon,11 'this sends out 14 bytes of configuration word
' at a rate of approx. 913kbps
inc idx
loop until idx = 14
low CS 'Enters Standby Mode and sets the configuration
low DATA1
goto Tx_Mode
'===============TRANSMIT=MODE=SUBROUTINE================================
Tx_Mode:
low CLK1
high CE 'Enable Active Mode
pauseus 5 'Tce2data = 5us
pauseus 0.5 'Ts = 500 ns
idx = 0
do
read Addr + idx,txsend 'Sends the 5-byte address out to the Transceiver
shiftout DATA1,CLK1,MSBFIRST,txsend,11
inc idx
loop until idx = 5
shiftout DATA1,CLK1,MSBFIRST,LEDVal,11 'Shift out the data byte
low CE 'Enters Standby Mode
pauseus 300 'Time On Air delay > calculated time for 64 bits = 256us
goto Tx_Mode
'===============DATA=TABLES=============================================
CfgWord: 'the configuration for Tx mode
data $08 'Data 1 width = 8bits
data $00 'receive-channel 2 not used
data $00
data $00
data $00
data $00
data $AA 'receice-channel 1 address :AA.BB.CC.DD.EE
data $BB
data $CC
data $DD
data $EE
data $A3 'Address witdh 5 bytes with 16bit CRC
data $6F 'Crystal = 16MHz, Data Rate = 250kpbs, Shockburst Mode & power output = 0dBm
data $14 'RF Channel #10 & Transmit mode.
Addr:
data $AA 'receice-channel 1 address :AA.BB.CC.DD.EE
data $BB
data $CC
data $DD
data $EE