AnsweredAssumed Answered

ESAI send 2 slots in one frame

Question asked by Tobias Härter on Jan 2, 2017

Hello

I develop bare-metal on the i.MX6 and have to use the ESAI to send two 16 bit values in a 32 bit slot.
At the moment I have a working ESAI interface but my values are not send correct.
ESAI registers after init:
ESAI register dump:
ECR: 0x00000001
ESR: 0x00000500
TFCR: 0x000C020D
TFSR: 0x00000000
TCR: 0x0001C903
TCCR: 0x00E00200
TSMA: 0x00000003
TSMB: 0x00000000
PRRC: 0x00000C18
PCRC: 0x00000C18


No I would send  two 16 bit values
0xAAAA 0xBBBB

int write_esai_tx1( uint16_t value1, uint16_t value2 )
{
    writel( (uint32_t) value1, (void *) ESAI_BASE + ETDR );
    while( !( ( readl( (void *) ESAI_BASE + ESR ) ) & 0x00000100 ) )
         ; // wait for TFE bit

    writel( (uint32_t) value2, (void *) ESAI_BASE + ETDR );
    while( !( ( readl( (void *) ESAI_BASE + ESR ) ) & 0x00000100 ) )
        ; // wait for TFE bit

    return 0;
}

but  as output on the TX1 line I get
0xAAAA 0xAAAA

Could anyone help me?
regards
Tobias

Outcomes