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.

TI Piccolo: PLL and SCI



I have a TI Piccolo that I'm trying to set up for serial communication. With my stronger DSP (F28335) I'm able to set up PLL the following way:

void PLL_Init()
{

// PLL to set CLK to 60 MHZ
SysCtrlRegs.PLLSTS.bit.DIVSEL = 0;
SysCtrlRegs.PLLCR.bit.DIV = 0xA;
SysCtrlRegs.PLLSTS.bit.DIVSEL = 2;
SysCtrlRegs.LOSPCP.all = 0x0;

}

This way I know that the speed when I divide it down to make the low speed clock. So for example when I set my baud rate fr the SCI I can divide 75MHz by 2 and then use the formula in the datasheet to get BRR. This doesn't seem to work on the piccolo though.. I change to code to reflect the piccolo's clock (60MHz max) and do the same process and I can't seem to receive anything on the SCIRXBUF register and this is only on the Piccolo. I would like to know if someone could tell me what is the minimum clock speed on the piccolo. Meaning, if i dont enable PLL, would the clock speed be 15 MHz? since the default is said to be OSCCLK/4. I'm a little confused about this. This is how I'm setting up the SCI registers:

void sci_init()
{
SysCtrlRegs.LOSPCP.bit.LSPCLK = 0; // low speed clock = SYSCLK/1
SysCtrlRegs.PCLKCR0.bit.SCIAENCLK = 1;

// SCI A for receiving stop command
SciaRegs.SCICCR.all = 0x7; // 8 bits, idle line mode on, no parity
SciaRegs.SCILBAUD = 0x30; // 48 for baud rate value of 38400
SciaRegs.SCIHBAUD = 0x0;
SciaRegs.SCICTL1.all = 0x23;

GpioCtrlRegs.GPAMUX2.all = 0x5000000; // set RX/TX for the UART chip GPIO29:28

}

  • Alan,

    For the 'F28335, the PLL settings necessary to clock the device at 150MHz depends on what the value of your external crystal is.  If using the controlCARD (note that on the controlCARD it is a 30MHz crystal) your above register settings should configure the clock to be 30MHz*10/2 = 150MHz.

    For the 'F28035, there is a choice in what clock source to use.  The default option on reset is to use the internal 10MHz oscillator (although you can choose to use an external crystal, etc).  If using the internal oscillator, the above PLL settings will configure you SYSCLK to be10MHz*10/2 = 50MHz.

    Based on the PLL settings you should then be able to choose the proper SCI baud register values.

    Note that if you have any doubt on what SYSCLK is, you can configure the pertinent GPIO to output XCLKOUT, which is a divided version of SYSCLK (divided as configured by the XCLK[XCLKOUTDIV] bit).

    Hopefully this helps.


    Thank you,
    Brett

  • I'm not sure if I'm doing anything wrong but my clock is pretty much stuck on 60MHz. I have a F28027 and I put C2 on the BRR register and it gives a baud of 38400. I put stuff on the TX Buffer and i can communicate with my computer at this baud. But I can't receive on the chip. Does this make sense? I'm not sure what other changes I can make. 

  • Alan,

    Are you using a controlCARD or your own custom board? 

    What are you using as a transceiver/How are you getting the computer output to GPIO28?

    Can you probe GPIO28 at the pin to see if it is toggling when the computer transmits?


    Thank you,
    Brett

  • I'm using a C2000 launch pad. I'm using putty for TX so when I write I see the logic on my LSA, but the RX flag does not go off at all. It's weird cuz i can TX from the launchpad no problem. and I receive the data on PUTTY or even on my visual studio.

  • I have another question if I may, i wanna use the ADC to monitor voltage drop on a battery. am i able to use any of the channels for this? i saw channel 5 does like temperature sensing and other channels deal with ref low and ref high. Is this something I should be concerned with? In the past with other chips I'd just set the ref, hook up an analog signal to a channel and see the result. Should I do this here as well? the example on the data sheet isn't very clear on that

  • Alan,

    Final question on the hardware just so I'm clear:  Are you using the FTDI as the transceiver (ie using the path from U1 to S4 to U6 to USB connector CON1?  Or are you connecting your own transceiver via J2/J6?

    From a software side, are there any error flags in the SCI while you're trying to receive?  It's been a while since I've looked into this, but if the SCI module has sensed a break detect (BRKDT), you will need to reset your SCI module to allow it to receive again.

    As for ADC, you may use whichever ADC input channel that you wish.  The ADC will then sample the channels based on how it's configured and be happy.  That being said, if you wish to use an external ADC reference (an internal reference exists so this is not necessary) or sample the internal temperature sensor (usually for calibration) you may wish to avoid those channels.


    Thank you,
    Brett