Hi,
I modified evmomapl138_test_upp example to use UPP's channel A to recieve data from ADC attached to the UI board of the OMAP-L138 EVM. 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 ?
Moreover, I enabled EOWI interrupt but it doesn't trigger to enter the ISR. I followed Sample Interrupt Service Routine given in section 2.6.4 of uPP User Guide to write ISR but I am not sure if that's written correctly. I also don't understand how could I enable next DMA transfer so that DMA continues to capture sampled data from ADC ?
Following are the code snippet:
int32_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 = 1; //dual channel mode
config.UPCTL.bits.MODE = 0; //0 all recv, 1 all xmit, 2 a recv b xmit, 3 a xmit b 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
//config.UPTCR.bits.RDSIZEI = 3;
//UPDLB
config.UPDLB.value=0; //no loopback
//UPIES
config.UPIES.bits.EOWI= 1; //turn on EOW(end of window) interrupt
//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);
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){};
}
interrupt void upp_isr(void)
{
UPISR_t interrupt_status;
interrupt_status.value = UPP->UPIER;
while (interrupt_status.value != 0)
{
if (interrupt_status.bits.EOWI)
{
interrupt_status.bits.EOWI = 1; // clear EOWI
// Handle EOWI
}
// loop again if any interrupts are left
interrupt_status.value = UPP->UPIER;
} // end of while
// write end of interrupt vector to allow future calls
UPP->UPEOI = 0;
} // end of function
I would really appreciate your quick help.
Regards,
BAS