QE128: I need SCI at 460800 baud with internal or external 32768Hz crystal

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

QE128: I need SCI at 460800 baud with internal or external 32768Hz crystal

2,513 Views
BasePointer
Contributor II
Hi,
 
I have a GPRS modul to communicate with QE128. But the modul needs 460800 baud communication speed at first to slow it down. I will send "AT+IPR=9600;&W" command at 460800 baud. And than all other communications with the module will establish at 9600baud.
 
Is this baud rate possible without using high speed external crystal with QE128?
 
Thank you,
BP.
Labels (1)
0 Kudos
7 Replies

466 Views
BasePointer
Contributor II
Thanks for all responses. Actually possible lowest bus frequency is better for this application because power consumption of the MCU is critical. My closest result was 13% for required baud rate :smileyhappy: I will try all your suggestions and let you know the result. I also learned differences between ICS and ICG with this project. ICG that is available in LC or other new series is more user friendly.
 
Thanks again,
BP.
0 Kudos

466 Views
Lundin
Senior Contributor IV
I did something similar once on a S12 connected to a Bluetooth chip. I then had a special "setup mode" used during manufacturing of the product, and when it was entered, the S12 scared up its PLL as high as possible, then attempted to send some AT command message over the SCI to lower the baudrate of the Bluetooth chip. Once that was done, the baudrate setting was saved in NVM on the chip and I didn't have to bother about it further and could run the MCU bus at normal speed.

Perhaps you could do something similar if your peripheral has NVM on-chip?

Message Edited by Lundin on 2008-10-15 11:06 AM
0 Kudos

466 Views
bigmac
Specialist III
Hello BP,
 
Even if the GPRS module cannot store the required baud rate data, it would only be necessary to use the higher bus frequency for a maximum of a few milliseconds, to set up the ICS and SCI modules, and send the few characters to alter the baud rate.  Then you could revert to your normal bus speed.  This will likely only need to be done when a reset occurs, and so should have minimal effect on the overall power consumption.
 
Regards,
Mac
 
0 Kudos

466 Views
BasePointer
Contributor II
Hi mac,
 
it worked perfectly.
 
fext = 32768Hz
mul = 1824
bdiv = 2^2
fBus = 32768*1824 / (4*2) = 7.471104 Mhz
 
SCIBaud = fBus / (16*1) = 466944 baud.
 
Thank you,
BP.
0 Kudos

466 Views
bigmac
Specialist III
Hello BP,
 
Using a 32.768kHz crystal, it would appear to be feasible provided you set up the ICS for a DCO frequency of 59.77MHz (see Table 11.7 of the reference manual), and a BDIV setting to provide a bus frequency of 14.9422 MHz.  If my calculations are correct, it should then be possible to provide a baud rate of 466,944 (BR = 2).  This is 1.3 percent higher than the required baud rate, but should normally be satisfactory.
 
Since you only need to send characters at the high baud rate, an alternative approach might be to bit bang the SCI send process, and once the lower baud rate was selected, to then enable the SCI module for further communications.  This might apply if you could not use the above ICS setting for any reason.
 
Regards,
Mac
 
0 Kudos

466 Views
Ake
Contributor II
Hi,
I have tried to make the transmisssion to happen at 460 kB, but it seems that the closest I could get was 471 kB. That is 2.6% off.
I have not tried to use the ICSTRM register, it might do it.
Neither have I tested that the message coming out on the TxD pin is the "AT+IPR=9600;&W" that you wanted to have.
But I hope that you can find something that is useful in my code.
 
Change the .txt file to .zip file before running WinZip on it.
 
Regards,
Ake
 
Message Edited by t.dowe on 2009-10-27 12:04 PM
0 Kudos

466 Views
JimDon
Senior Contributor III
Why are you setting the CPU clock so low?
I recommend you use PE to set the clock and the SCI baud rate. Create a test project.
It will calculate the register values and show you the error, very nice for  "what ifs".
I also recommend that you use the test project to try out talking to the device.


0 Kudos