Hi,
I'm using the UPP peripheral on OMAP-L138 board, LogicPD EVM UI board has 10 bit ADC attached to it, I am trying to make ADC working to gather high frequency signal then process it in real-time. I tried to modify evmomapl138_test_upp example code to use only one channel (A) of the UPP in recieve mode. I don't get a proper 100 kHz sine wave after configuring CHN bit in UPTCL register to zero but it does work with CHN = 1(dual channel mode). Why is that ?
Here is the snippet from my code:
uint32_t TEST_adcdac(void)
{
uint32_t retVal = ERR_NO_ERROR;
I2CGPIO_init(I2C_ADDR_GPIO_UI); //IO expander on UI board
I2CGPIO_setOutput(I2C_ADDR_GPIO_UI, I2C_GPIO_UI_SELA, OUTPUT_HIGH);
I2CGPIO_setOutput(I2C_ADDR_GPIO_UI, I2C_GPIO_UI_SELB, OUTPUT_LOW);
I2CGPIO_setOutput(I2C_ADDR_GPIO_UI, I2C_GPIO_UI_SELC, OUTPUT_LOW); // only ADC is selected
//Setup ADC Clock
CDCE913_setOutput(cdce913_output_2, 6); //set to 4.5Mhz
executeTest();
}
uint32_t executeTest(void)
{
upp_config_t config;
UPXS2_t * UPIS2r = (UPXS2_t *)&(UPP->UPIS2);
//UPCTL
config.UPCTL.value=0;
config.UPCTL.bits.DPFA = 0;
config.UPCTL.bits.DPWA = 2; //10 bit data
config.UPCTL.bits.IWA = 1; //16 bit interface
config.UPCTL.bits.CHN = 0; //Single channel mode. Only Channel A is active.
config.UPCTL.bits.MODE = 0; //0 all recv
//UPICR
config.UPICR.value=0;
//UPIVR
config.UPIVR.value=0;
config.UPIVR.bits.VALA = 0x0000;
//UPTCR
config.UPTCR.value=0; //all values 0 for 64byte DMA bursts read / write
//UPDLB
config.UPDLB.value=0; //no loopback
//UPIES
config.UPIES.value=0; //dont enable any interrupts
//UPPCR
config.UPPCR.value = 0;
config.UPPCR.bits.EN = 1; //enable uPP
config.UPPCR.bits.RTEMU = 1; //allow emulator use
config.UPPCR.bits.SOFT = 1; //allow emulation
UPP_init(&config);
printf("---Collecting 1024 samples from ADC---\r\n");
UPP->UPID0 = (uint32_t)&recv_buffer;//add next DMA transfer
UPP->UPID1 = 0x00010800; //1 lines 128 bytes per line
UPP->UPID2 = 0x00000800; //no offset between lines
while(UPIS2r->bits.PEND == 1){};
}
This program runs only once but I want to continue sample and process data coming from ADC. I want to enable EOWI to enter ISR to process the sampled data. During the time sampled data is being processed, it should collect another bunch of 1024 point data from ADC to maintain real-time operation. It should be possible right ?
I had a look over pseudo-code in Section 2.6.4 of uPP user guide but couldn't quite understand how to write ISR associated with EOWI.
I would appreciate if someone give a little push to start developing the code and comments on the problem I stated earlier.
Thanks a lot for your time.
Regards,
BAS