SAME70Q21A SSC as I2S

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, good morning.

 

I was try to use internal SSC in I2S role, i used asf 3.47.0.1648 template and config tips from http://ww1.microchip.com/downloa... but oscilogram was still invalid.

Yesterday i was find proper config but big different that atmel delivery. Here is my solution:

    pio_configure(PIOD, PIO_PERIPH_B, PIO_PD26, 0);   // TD
    pio_configure(PIOB, PIO_PERIPH_D, PIO_PB1, 0);    // TK
    pio_configure(PIOB, PIO_PERIPH_D, PIO_PB0, 0);    // TF

    clock_opt_t tx_clk_option;
    data_frame_opt_t tx_data_frame_option;

    tx_clk_option.ul_cks = SSC_TCMR_CKS_MCK;
    tx_clk_option.ul_cko = SSC_TCMR_CKO_TRANSFER;
    tx_clk_option.ul_cki = SSC_TCMR_CKI;
    tx_clk_option.ul_ckg = SSC_TCMR_CKG_CONTINUOUS;
    tx_clk_option.ul_start_sel = SSC_TCMR_START_CONTINUOUS;
    tx_clk_option.ul_sttdly = 0;
    tx_clk_option.ul_period = 15;

    tx_data_frame_option.ul_datlen = 17;
    tx_data_frame_option.ul_msbf = SSC_TFMR_MSBF;
    tx_data_frame_option.ul_datnb = 1;
    tx_data_frame_option.ul_fslen = 0;
    tx_data_frame_option.ul_fslen_ext = 0;
    tx_data_frame_option.ul_fsos = SSC_TFMR_FSOS_TOGGLING;
    tx_data_frame_option.ul_fsedge = SSC_TFMR_FSEDGE_POSITIVE;

    ssc_set_transmitter(SSC, &tx_clk_option, &tx_data_frame_option);

    ssc_enable_tx(SSC);
    ssc_enable_interrupt(SSC, SSC_SR_TXRDY);

 

 

I'm using this with SSC_Handler:

 

ISR( SSC_Handler ){
    uint32_t volatile ssc_isr = REG_SSC_SR;

    if(channel == 0){
        REG_SSC_THR = (uint32_t)( 0x0000FFFF & data_channel_a);
        channel = 1;
    }else{
        REG_SSC_THR = (uint32_t)( 0x0000FFFF & data_channel_b);
        channel = 0;
    };
};

 

 

Today i successfuly send some sound probe form this sam to NAU8822 codec, so i think it is good job. Ofc next step will be init xdmac and other peripherals, but it is not matter here.

I was write own software driver for I2C, hardware driver/software not work stable (if it work at any circumstates), i don't have more time to find solution.

 

I have the silicon version marked A.

 

Your suggestions will be appreciated.

Last Edited: Sat. Feb 29, 2020 - 11:24 PM