Post Go back to editing

Is SPORT0 on BF506F really working?

Good morning..

I have a problem for the init of SPORT0 on the BF506F. I need to connect to the codec AD73311.

I used the PF8 and PF9 for SE and RESET pin of the codec.

The codec goes quietly out of reset, I see the clock and frame coming out of it.

The frequency of the clock is about 2 MHz and the frame signals are every 16 clocks.

It looks compatible with the reset condition of the codec.

I init the SPORT0 with only the TFSR bit, the others are 0 as in framed connections, since

the clock is produced from the codec to both rx and tx side of sport, again the frame signals are

originated from the codec for everything, 2 pins of uP and 2 of codec tied togheter.

The PORTF_MUX is 0, PORTF_FER is 0x3F. I do not use the secondary channel.

I write in the fifo prior the enabling. I enable the TX and I see on debugger the STATUS of

sport0 becomes 5, so all of the data are serialized out. But nothing is visible on the scope,

and the codec is not initialized.

If for test I leave the codec in reset and not enabled, the clocks and frames disappear,

when I enable the sport0 the STATUS remains 4, so the data effectively are not serialized.

That's normal. I wander what prevents the DT0PRI to send out the data, it is evident the

SPORT internally is working.

The project does not handle the interrupts. But I tested with interrupts and I regularly get

the interrupt for TUVF flag. So again the SPORT0 seems to do a regular work internally, but

nothing appears on the txout pin transmitted.

More the pin is not stucked. If I set as I/O I manipulate su switch properly.

The project is attached.

Thank You

TestAd733_sketch.zip
  • Hi,

    If the SPORT is configured for wordlength of 16-bit or less, you should access SPORT Transmit Data Buffer register as 16-bit register. This is applicable only when you are writing code in C.

    The cdefBF50x_base. header file defines these data-type converted registers:
    #define pSPORT0_TX16 ((volatile unsigned short *)SPORT0_TX)
    #define pSPORT1_TX16 ((volatile unsigned short *)SPORT1_TX)

    So, use *pSPORTx_TX16 register instead of simply *pSPORTx_TX.. Please try this and let me know if it works.

    Thanks,

    PG

  • Hei..

    The SPORT0 is correctly working now. The AD73311L is not reading the initialization but I think I will find the error, now

    the hardware is the problem, I will fix

    Thank You Very much