This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TAS1020B and UART

Hi all,

I have built my own TAS1020B test hardware and so far its working great. The only problem is I need to use the UART to control a module connected to the RX/TX of the TAS1020B. This module require the baudrate to be set at 115200. Although I can set up the UART but couldnt achieve the correct baudrate. The TAS1020B is using a 6MHz crystal, from what I understand I will need to use a 5.5296Mhz crystal to generate the perfect 115200 baudrate. I beleive this will mess up the internal timing of the TAS1020B but is there anyway to correct the timing by chaging the value of some registers?

I know it is possible to use an SPI /  I2C to UART bridge but I want to avoid this route if possible.

Many thanks

  • Chris,

    Almost all of the UART functionality in the TAS1020B is via the 8052 core.  The MCUCLK setting can double the MCU clock frequency, so I suggest using MCUCLK=1b to double the frequency of the input to the 8052 Timer2, for more granularity.

    The 8052's T2 is used to generate the UART clock.

    Are you saying that you can't get close enough to 115.2k using these adjustable parms?

    -----------

    The 8052 UART doesn't provide hardware flow control.  Any chance you can use a baud rate below 115.2k?

    Regards,

    Frank

  • Hi Frank

    Many thanks for the quick reply.

    I did had a look at the keil website :

    http://www.keil.com/c51/baudrate.asp

    and according to that and other forums, it is not possible to generate 115200 with the 6Mhz crystal. But I will take a look at your suggestion later on and see if I missed something.

    No it is not possible to set the rate lower, the module is fixed at 115200. All I need is 115200 RX/TX and a reset (any bit from GPIO will do) so I can connect this module to the TAS1020B and control it using HID while the audio is streamed from the module to the PC.

    and many thanks for your help Frank, your previous post did help me alot, the files TRY6.ZIP and TRY7.ZIP were very very useful piece for me. I did check if you have a new version but no luck. Anyway this is what Im trying to do, a radio module which outputs an I2S, 16bit, 48Khz, master. All I did was set the direction of the clocks and adjust a few parameters and it worked.

    On another topics, is there any example windows apps around to send/receive data to/from the TAS1020B via HID? I had a quick look at Jan Axelson's example but an example made for the TAS1020B would be easier for me to understand. VB .Net if possible, I will probably make a new thread for that.

    Thanks

  • Chris,

    The 6MHz crystal clock is used for a number of PLLs inside the device.  These PLLs have not been characterized for clock inputs other than 6MHz, so I can't recommend using a crystal of a different frequency.  If you try that, you are definitely in the roll of test pilot (and be prepared to eject!) - and note that you would have to provide different ACG settings for your 48kHz.

    I don't have a Windows HID application for the TAS1020B.  I know that other TAS1020B users have used a HID interface for things other than the keyboard-like interface that's used in the FDK application.  Here's an application for a different device that may give you some help: 4442.usb2i2c.c.zip

    If I get some time today I'll try an app I have for the TUSB3200A (its 8052 core is almost identical) that sets T2 to run faster (it currently works at 19.2kHz via 0xFFDA) to see if I can come up with a value 'close enough' that Hyperterm can use it at 115.2.

    Regards,

    Frank

     

     

  • Chris,

    I've had no luck trying to build the baud rate from the internal clock.

    Have you tried using an external trigger via P1.0 or P1.1 for T2?

    Frank

  • Hi Frank

    Many thanks for trying. I think its definately not possible, I did try the calculation with 24MHz clock but the divisor for timer 2 is just to large (32). This is the first time Im using 8051/52 so Im not familiar with the HW. I will check to see if the divisor can be lowered.

    Yes I did had a looked at the external trigger earlier, I will probably just clock that to produce 115200.

    I will let you know how it goes.

    Once again many thanks.

  • Chris Johnson said:

    Hi all,

    I have built my own TAS1020B test hardware and so far its working great. The only problem is I need to use the UART to control a module connected to the RX/TX of the TAS1020B. This module require the baudrate to be set at 115200. Although I can set up the UART but couldnt achieve the correct baudrate. The TAS1020B is using a 6MHz crystal, from what I understand I will need to use a 5.5296Mhz crystal to generate the perfect 115200 baudrate. I beleive this will mess up the internal timing of the TAS1020B but is there anyway to correct the timing by chaging the value of some registers?

    The TAS1020B's 8052 core runs at either 12 MHz or 24 MHz, depending on the MCUCLK bit in the GLOBCTL register.

    Try the Keil baud-rate calculator tool at http://www.keil.com/products/c51/baudrate.asp.

    Given a 12 MHz clock and Timer 2 (T2CON set to 0x34), setting RCAP2H,RCAP2L to 0xFF and 0x98 should get you to 115,384.62 bps.

    -a