1 Reply Latest reply on Aug 7, 2011 4:03 PM by robert.seczkowski

    rtx51tiny and pheripherials

    robert.seczkowski

      Does anyone has experience with ADC->FILTER withing rtx51tiny

         

      It looks, that however example Projects for Rtx51tiny work well, but all other fail.

         

      ADC reads fixed value 0x90DB regardless of input.

         

      FIlter don't fire data ready interrupt

         

      regards

         

      robert

        • 1. Re: rtx51tiny and pheripherials
          robert.seczkowski

          Below is my initialization code:

             

          16-bit ADC ->DMA -> FILTER ->DMA -> SRAM

             

           

             

          uint8 DMA_ADC_Chan;
          uint8 DMA_ADC_TD[1];
          extern uint16 fdata[32];
          /* DMA Configuration for DMA_ADC */
          #define DMA_ADC_BYTES_PER_BURST 2
          #define DMA_ADC_REQUEST_PER_BURST 1
          #define DMA_ADC_SRC_BASE (CYDEV_PERIPH_BASE)
          #define DMA_ADC_DST_BASE (CYDEV_PERIPH_BASE)

          /* Variable declarations for DMA_F */
          /* Move these variable declarations to the top of the function */
          uint8 DMA_F_Chan;
          uint8 DMA_F_TD[1];

          /* DMA Configuration for DMA_F */
          #define DMA_F_BYTES_PER_BURST 2
          #define DMA_F_REQUEST_PER_BURST 1
          #define DMA_F_SRC_BASE (CYDEV_PERIPH_BASE)
          #define DMA_F_DST_BASE (CYDEV_SRAM_BASE)




          void Init (void) _task_ INIT
          {
          isr_DMA_Start();
          IDAC8_Start();
          ADC_DelSig_Start();
          ADC_DelSig_IRQ_Disable();
          Filter_Start();
          Filter_COHER_REG = 0x00;
          Filter_DALIGN_REG = 0x0F;
          CYGlobalIntEnable;
          ADC_DelSig_DEC_COHER_REG  = 0x0a;
          VDAC8_Start();
          VDAC8_SetValue(0x40);
          DMA_ADC_Chan = DMA_ADC_DmaInitialize(DMA_ADC_BYTES_PER_BURST, DMA_ADC_REQUEST_PER_BURST,
              HI16(DMA_ADC_SRC_BASE), HI16(DMA_ADC_DST_BASE));
          DMA_ADC_TD[0] = CyDmaTdAllocate();
          CyDmaTdSetConfiguration(DMA_ADC_TD[0], 2, DMA_ADC_TD[0],TD_INC_DST_ADR|TD_INC_SRC_ADR);
          CyDmaTdSetAddress(DMA_ADC_TD[0], LO16((uint32)ADC_DelSig_DEC_SAMPM_PTR), LO16((uint32)Filter_STAGEA_PTR));
          CyDmaChSetInitialTd(DMA_ADC_Chan, DMA_ADC_TD[0]);
          CyDmaChEnable(DMA_ADC_Chan, 1);
          DMA_ADC_Chan = DMA_ADC_DmaInitialize(DMA_ADC_BYTES_PER_BURST, DMA_ADC_REQUEST_PER_BURST,
              HI16(DMA_ADC_SRC_BASE), HI16(DMA_ADC_DST_BASE));
          DMA_ADC_TD[0] = CyDmaTdAllocate();
          CyDmaTdSetConfiguration(DMA_ADC_TD[0], 64, DMA_ADC_TD[0], TD_SWAP_EN | DMA_ADC__TD_TERMOUT_EN | TD_INC_DST_ADR);
          CyDmaTdSetAddress(DMA_ADC_TD[0], LO16((uint32)Filter_HOLDA_PTR), LO16((uint32)fdata));
          CyDmaChSetInitialTd(DMA_ADC_Chan, DMA_ADC_TD[0]);
          CyDmaChEnable(DMA_ADC_Chan, 1);






              RTX51_Start();                /* Enable the RTX51Tiny */
               ADCTaskInit();                /* initialize the ADC task */
              HVTaskInit();            /* initialize the Impeller task */
              COMTaskInit();
              FFTTaskInit();
              os_delete_task (INIT);         /* done with initialization */
          }