Other Parts Discussed in Thread: CC3220SF
Tool/software: TI-RTOS
Hello. I am trying to setup a configuration where the dma transfers 64 samples in a buffer. As it is my first time working with a RTOS and TI Products, i have little experience programming the device. Below is the main thread. Please note that i have used driverlib and TI-drivers together where possible, and while debugging , the buffer doesn't fill with any samples, although the ADC is working(i have tested that)
* ======== empty.c ========
*/
/* For usleep() */
#include <unistd.h>
#include <stdint.h>
#include <stddef.h>
#include <ti/devices/cc32xx/inc/hw_memmap.h>
#include <ti/devices/cc32xx/inc/hw_ocp_shared.h>
#include <ti/devices/cc32xx/inc/hw_ints.h>
#include <ti/devices/cc32xx/inc/hw_types.h>
#include <ti/devices/cc32xx/inc/hw_adc.h>
/* Driverlib Header Files */
#include <ti/devices/cc32xx/driverlib/rom.h>
#include <ti/devices/cc32xx/driverlib/rom_map.h>
#include <ti/devices/cc32xx/driverlib/udma.h>
#include <ti/devices/cc32xx/driverlib/adc.h>
/* Driver Header files */
#include <ti/drivers/GPIO.h>
#include <ti/drivers/dma/UDMACC32XX.h>
#include <ti/drivers/ADC.h>
#include <ti/drivers/adc/ADCCC32XX.h>
// #include <ti/drivers/I2C.h>
// #include <ti/drivers/SDSPI.h>
// #include <ti/drivers/SPI.h>
// #include <ti/drivers/UART.h>
// #include <ti/drivers/Watchdog.h>
/* Board Header file */
#include "Board.h"
/*
* ======== mainThread ========
*/
void *mainThread(void *arg0)
{
unsigned int buffer[65]={1024};
UDMACC32XX_Handle udma;
ADC_Handle adcch2;
ADC_Params param;
ADC_Params_init(¶m);
/* set up the dma channel transfer */
UDMACC32XX_init();
udma=UDMACC32XX_open();
uDMAChannelAssign(UDMA_CH16_ADC_CH2);
uDMAChannelControlSet(UDMA_CH16_ADC_CH2|UDMA_PRI_SELECT, UDMA_SIZE_32|UDMA_SRC_INC_NONE|UDMA_DST_INC_32|UDMA_ARB_1);
uDMAChannelAttributeEnable(UDMA_CH16_ADC_CH2,UDMA_ATTR_USEBURST);
uDMAChannelTransferSet(UDMA_CH16_ADC_CH2|UDMA_PRI_SELECT,UDMA_MODE_BASIC,(void*)(ADC_BASE+ADC_O_channel2FIFODATA),(void*)0x20000678,63);
uDMAChannelAttributeEnable(UDMA_CH16_ADC_CH2,UDMA_ATTR_REQMASK);
uDMAChannelEnable(UDMA_CH16_ADC_CH2);
/* set up the ADC channel */
ADC_init();
adcch2=ADC_open(CC3220SF_LAUNCHXL_ADC0,¶m);
ADCChannelDisable(ADC_BASE, ADCCC32XX_PIN_59_CH_2);
ADCDMAEnable(ADC_BASE, ADCCC32XX_PIN_59_CH_2);
ADCChannelEnable(ADC_BASE, ADCCC32XX_PIN_59_CH_2);
while(1){
}
}
Please point me in some direction if possible and thank you in anticipation.