Other Parts Discussed in Thread: AWR1443,
雷达相关的硬件配置参考我原先的帖子:
为了完成Hardware Trigger,我卸除了DCA1000上的R120电阻,通过J5 P10将SYNC_IN接入STM32的定时器上,通过STM32定时器输出2us的3.3V短脉冲以触发。
以下为我精确地生成了20个2us短脉冲示波器图(紫色):
但最终实际录制到的adc_data_Raw_0.bin仅为12 kb:
另附以上文件的压缩包:
然而当我配置模式为Software Trigger模式时,它正确地录制了240KB的数据:
文件如下:
从上面观察来看,短脉冲确实能够触发雷达工作但是不知原因为何,DCA1000只录制了最开始的一帧便不再工作。
相关的lua脚本分为俩部分:配置和录制:
/-----------------------------------------------------------------------------------------------------------------------/
--BSS and MSS firmware download
info = debug.getinfo(1,'S');
file_path = (info.source);
file_path = string.gsub(file_path, "@","");
file_path = string.gsub(file_path, "Data_AWR1443_Config_MIMO.lua","");
fw_path = file_path.."..\\..\\rf_eval_firmware"
--Export bit operation file
bitopfile = file_path.."\\".."bitoperations.lua"
dofile(bitopfile)
--Read part ID
--This register address used to find part number for ES2 and ES3 devices
res, efusedevice = ar1.ReadRegister(0xFFFFE214, 0, 31)
res, efuseES1device = ar1.ReadRegister(0xFFFFE210, 0, 31)
efuseES2ES3Device = bit_and(efusedevice, 0x03FC0000)
efuseES2ES3Device = bit_rshift(efuseES2ES3Device, 18)
--if part number is zero then those are ES1 devices
if(efuseES2ES3Device == 0) then
if (bit_and(efuseES1device, 3) == 0) then
partId = 1243
elseif (bit_and(efuseES1device, 3) == 1) then
partId = 1443
else
partId = 1642
end
elseif(efuseES2ES3Device == 0xE0 and (bit_and(efuseES1device, 3) == 2)) then
partId = 6843
ar1.frequencyBandSelection("60G")
--if part number is non-zero then those are ES12 and ES3 devices
else
if(efuseES2ES3Device == 0x20 or efuseES2ES3Device == 0x21 or efuseES2ES3Device == 0x80) then
partId = 1243
elseif(efuseES2ES3Device == 0xA0 or efuseES2ES3Device == 0x40)then
partId = 1443
elseif(efuseES2ES3Device == 0x60 or efuseES2ES3Device == 0x61 or efuseES2ES3Device == 0x04 or efuseES2ES3Device == 0x62 or efuseES2ES3Device == 0x67) then
partId = 1642
elseif(efuseES2ES3Device == 0x66 or efuseES2ES3Device == 0x01 or efuseES2ES3Device == 0xC0 or efuseES2ES3Device == 0xC1) then
partId = 1642
elseif(efuseES2ES3Device == 0x70 or efuseES2ES3Device == 0x71 or efuseES2ES3Device == 0xD0 or efuseES2ES3Device == 0x05) then
partId = 1843
elseif(efuseES2ES3Device == 0xE0 or efuseES2ES3Device == 0xE1 or efuseES2ES3Device == 0xE2 or efuseES2ES3Device == 0xE3 or efuseES2ES3Device == 0xE4) then
partId = 6843
ar1.frequencyBandSelection("60G")
else
WriteToLog("Inavlid Device part number in ES2 and ES3 devices\n" ..partId)
end
end
-- Check if partId is not 1443 and terminate the program with an error message
if partId ~= 1443 then
WriteToLog("This script is only compatible with AWR1443BOOST devices. Please use DataCaptureDemo_xWR.lua for other devices.\n", "red")
os.exit()
end
--ES version
res, ESVersion = ar1.ReadRegister(0xFFFFE218, 0, 31)
ESVersion = bit_and(ESVersion, 15)
--ADC_Data file path
data_path = file_path.."..\\PostProc"
adc_data_path = data_path.."\\adc_data.bin"
BSS_FW = fw_path.."\\radarss\\xwr12xx_xwr14xx_radarss.bin"
MSS_FW = fw_path.."\\masterss\\xwr12xx_xwr14xx_masterss.bin"
-- Download BSS Firmware
if (ar1.DownloadBSSFw(BSS_FW) == 0) then
WriteToLog("BSS FW Download Success\n", "green")
else
WriteToLog("BSS FW Download failure\n", "red")
end
-- Download MSS Firmware
if (ar1.DownloadMSSFw(MSS_FW) == 0) then
WriteToLog("MSS FW Download Success\n", "green")
else
WriteToLog("MSS FW Download failure\n", "red")
end
-- SPI Connect
if (ar1.PowerOn(1, 1000, 0, 0) == 0) then
WriteToLog("Power On Success\n", "green")
else
WriteToLog("Power On failure\n", "red")
end
-- RF Power UP
if (ar1.RfEnable() == 0) then
WriteToLog("RF Enable Success\n", "green")
else
WriteToLog("RF Enable failure\n", "red")
end
if (ar1.ChanNAdcConfig(1, 1, 1, 1, 1, 1, 1, 2, 2, 0) == 0) then
WriteToLog("ChanNAdcConfig Success\n", "green")
else
WriteToLog("ChanNAdcConfig failure\n", "red")
end
if (partId == 1642) then
if (ar1.LPModConfig(0, 1) == 0) then
WriteToLog("LPModConfig Success\n", "green")
else
WriteToLog("LPModConfig failure\n", "red")
end
else
if (ar1.LPModConfig(0, 0) == 0) then
WriteToLog("Regualar mode Cfg Success\n", "green")
else
WriteToLog("Regualar mode Cfg failure\n", "red")
end
end
if (ar1.RfInit() == 0) then
WriteToLog("RfInit Success\n", "green")
else
WriteToLog("RfInit failure\n", "red")
end
RSTD.Sleep(1000)
if (ar1.DataPathConfig(1, 1, 0) == 0) then
WriteToLog("DataPathConfig Success\n", "green")
else
WriteToLog("DataPathConfig failure\n", "red")
end
if (ar1.LvdsClkConfig(1, 1) == 0) then
WriteToLog("LvdsClkConfig Success\n", "green")
else
WriteToLog("LvdsClkConfig failure\n", "red")
end
if (ar1.LVDSLaneConfig(0, 1, 1, 1, 1, 1, 0, 0) == 0) then
WriteToLog("LVDSLaneConfig Success\n", "green")
else
WriteToLog("LVDSLaneConfig failure\n", "red")
end
if(ar1.ProfileConfig(0, 77, 7, 4.66, 56.9, 0, 0, 0, 0, 0, 0, 70, 0, 256, 5000, 0, 0, 30) == 0) then
WriteToLog("ProfileConfig Success\n", "green")
else
WriteToLog("ProfileConfig failure\n", "red")
end
if (ar1.ChirpConfig(0, 0, 0, 0, 0, 0, 0, 1, 0, 0) == 0) then --(100)tx0
WriteToLog("ChirpConfig Success\n", "green")
else
WriteToLog("ChirpConfig failure\n", "red")
end
if (ar1.ChirpConfig(1, 1, 0, 0, 0, 0, 0, 0, 1, 0) == 0) then --(010)tx1
WriteToLog("ChirpConfig Success\n", "green")
else
WriteToLog("ChirpConfig failure\n", "red")
end
if (ar1.ChirpConfig(2, 2, 0, 0, 0, 0, 0, 0, 0, 1) == 0) then
WriteToLog("ChirpConfig Success\n", "green")
else
WriteToLog("ChirpConfig failure\n", "red")
end
if (ar1.FrameConfig(0, 2, 0, 1, 1342, 0, 0, 2) == 0) then
WriteToLog("FrameConfig Success\n", "green")
else
WriteToLog("FrameConfig failure\n", "red")
end
-- select Device type
if (ar1.SelectCaptureDevice("DCA1000") == 0) then
WriteToLog("SelectCaptureDevice Success\n", "green")
else
WriteToLog("SelectCaptureDevice failure\n", "red")
end
--DATA CAPTURE CARD API
if (ar1.CaptureCardConfig_EthInit("192.168.33.30", "192.168.33.180", "12:34:56:78:90:12", 4096, 4098) == 0) then
WriteToLog("CaptureCardConfig_EthInit Success\n", "green")
else
WriteToLog("CaptureCardConfig_EthInit failure\n", "red")
end
if (ar1.CaptureCardConfig_Mode(1, 1, 1, 2, 3, 30) == 0) then
WriteToLog("CaptureCardConfig_Mode Success\n", "green")
else
WriteToLog("CaptureCardConfig_Mode failure\n", "red")
end
if (ar1.CaptureCardConfig_PacketDelay(25) == 0) then
WriteToLog("CaptureCardConfig_PacketDelay Success\n", "green")
else
WriteToLog("CaptureCardConfig_PacketDelay failure\n", "red")
end
/-----------------------------------------------------------------------------------------------------------------------/
--BSS and MSS firmware download
info = debug.getinfo(1,'S');
file_path = (info.source);
file_path = string.gsub(file_path, "@","");
file_path = string.gsub(file_path, "Data_AWR1443_Capture_MIMO.lua","");
fw_path = file_path.."..\\..\\rf_eval_firmware"
--Export bit operation file
bitopfile = file_path.."\\".."bitoperations.lua"
dofile(bitopfile)
--Read part ID
--This register address used to find part number for ES2 and ES3 devices
res, efusedevice = ar1.ReadRegister(0xFFFFE214, 0, 31)
res, efuseES1device = ar1.ReadRegister(0xFFFFE210, 0, 31)
efuseES2ES3Device = bit_and(efusedevice, 0x03FC0000)
efuseES2ES3Device = bit_rshift(efuseES2ES3Device, 18)
--ES version
res, ESVersion = ar1.ReadRegister(0xFFFFE218, 0, 31)
ESVersion = bit_and(ESVersion, 15)
--ADC_Data file path
data_path = file_path.."..\\PostProc"
adc_data_path = data_path.."\\adc_data.bin"
BSS_FW = fw_path.."\\radarss\\xwr12xx_xwr14xx_radarss.bin"
MSS_FW = fw_path.."\\masterss\\xwr12xx_xwr14xx_masterss.bin"
if (ar1.FrameConfig(0, 2, 0, 1, 1342, 0, 0, 2) == 0) then
WriteToLog("FrameConfig Success\n", "green")
else
WriteToLog("FrameConfig failure\n", "red")
end
--Start Record ADC data
ar1.CaptureCardConfig_StartRecord(adc_data_path, 1)
RSTD.Sleep(1000)
--Trigger frame
ar1.StartFrame()
RSTD.Sleep(1000)
/-----------------------------------------------------------------------------------------------------------------------/