Other Parts Discussed in Thread: HALCOGEN
Hi,
I have a TMS570LS20216
USB stick and running the SPI slave demo code
(example_mibspi_halcogen_ccs_c_project.zip) obtained from the TMS570
wiki (http://processors.wiki.ti.com/index.php/Category:TMS570) in the
'Training & Videos' section. This zip contains an SPI slave project
that I am running with no changes to the code.
I am modifying the example so as to receive data (more than 1 kB) streamed in from the master. My intention is to DMA this incoming data straight into RAM on a byte by byte basis. Currently my SPI is configured to use multi buffers, but my intention is not to use multi-buffers but DMA each byte from the SPIBUF as it arrives. This is becasue the messages form the master can be of variable byte length.
I change to single buffer using:
SPIRegAdd->MSPIENA = 0; // MSPIENA - Multi-buffer mode dis-able
but am at a loss as how to configure the SPI's DMA interrupt to signal the DMA module to DMA the SPIBUF to RAM.
I am also unsure how to configure the incrementing of the DMA destination pointer. At present I have:
SPICtrlPktData.Frame_Cnt = 1; // FRM_CNT 1 Frame transfer
SPICtrlPktData.Elmnt_Cnt = NUMB_ELEMENTS; // ELM_CNT 10 Element per Frame
SPICtrlPktData.Read_Size = ACCESS_8_BIT; // RD_SIZE Size of source element
SPICtrlPktData.Write_Size = ACCESS_8_BIT; // WR_SIZE Size of destination element
SPICtrlPktData.Trans_Type = FRAME_TRANSFER; // TRANSFER_TYPE
SPICtrlPktData.Addr_Mode_Read = ADDR_INC1; // RD_ADDR_MODE Auto increment src (read) address by size of read element
SPICtrlPktData.Addr_Mode_Write = ADDR_INC1; // WR_ADDR_MODE Auto increment dest (write) address by size of write element
SPICtrlPktData.Autoinit = AUTOINIT_OFF; // AUTOINIT Disable
SPICtrlPktData.channel_Ctrl = 0x00; // channel Ctrl info by default NO CHanning is Enabled.
SPICtrlPktData.Elmnt_Dst_Offst = 0; // EIDXD (for Index mode)
SPICtrlPktData.Elmnt_Src_Offst = 0; // EIDXS (for Index mode)
SPICtrlPktData.Frame_Dst_Offst = 0; // FIDXD (for Index mode)
SPICtrlPktData.Frame_Src_Offst = 0; // FIDXS (for Index mode)
Although I believe I have the length correct (8 bits) I am uncertain with respect to the element, frame and block sizes. I am intending to use 1 element per frame and 1 frame per block. Is this along the correct lines?
Can you clarify the above points for me please?
Steve