<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>8-bit MicrocontrollersのトピックRe: QG8 Higher Baud Rates</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140755#M5749</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi Bigmac and Peg,&lt;BR /&gt;&lt;BR /&gt;I tried a few values in the TRIM register, it turns out that 0x7C results in the TX output bit period to be very close to 8.7 us. I reran the test using 0x40 value characters from the transmitter and it works great!!&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;I found Peg's comment very interesting about the receiver re-synch, I was not aware of this.&lt;BR /&gt;&lt;FONT color="#6633FF"&gt;"The byte $55 is the easiest to get through on a mis-matched baudrate as it is a square wave and all those falling edges re-synch the reciever sampler."&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I am now working on how to auto calibrate the ICS.&lt;BR /&gt;&lt;BR /&gt;Out of curiosity, I tried to find where the NV_ICSTRM_INITVAL is actually initialized in Flash (0xFFAF), but so far I have only found the following Tip and #define in the MC9S08QG8.h file.&lt;BR /&gt;&lt;BR /&gt;/* Tip for register initialization in the user code:&amp;nbsp; const byte NV_ICSTRM_INIT @0x0000FFAF = &amp;lt;NV_ICSTRM_INITVAL&amp;gt;; */&lt;BR /&gt;#define _NV_ICSTRM (*(const NV_ICSTRMSTR * __far)0x0000FFAF)&lt;BR /&gt;&lt;BR /&gt;I looked through the startup code as well.&lt;BR /&gt;&lt;BR /&gt;Thanks so much for your help!&lt;BR /&gt;David&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jul 2007 21:46:05 GMT</pubDate>
    <dc:creator>datamstr</dc:creator>
    <dc:date>2007-07-25T21:46:05Z</dc:date>
    <item>
      <title>QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140737#M5731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Greetings!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using the QG8 internal clock, I can receive a byte (SCI) at up to 38400 BAUD. Has anyone got it working at either 57600 or 115200 BAUD? How did you do it? Do I have to go up to a "non-standard" BAUD Rate?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Jul 2007 23:17:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140737#M5731</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2007-07-20T23:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140738#M5732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi David,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;A search of the forums with the keywords QG8 baud revealed the following:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=2397" target="_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&amp;amp;message.id=2397&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;along with several others that cover this well enough I think.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jul 2007 07:51:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140738#M5732</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-07-21T07:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140739#M5733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks Peg!&lt;BR /&gt;&lt;BR /&gt;David&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Jul 2007 09:51:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140739#M5733</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2007-07-21T09:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140740#M5734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi Peg,&lt;BR /&gt;&lt;BR /&gt;I set the Internal Clock Freq to 36 KHZ and the Baud Rate Divisor to 5. The CW Bean Inspector shows the Baud Rate at 115,200, so far so good. I am actually missing every other byte using the SCI Port even when the transmitter sends only a few bytes at a time. If I add a delay after each byte on the transmitter side, the SCI receiver does get every byte. Therefore I suspect that have a small mismatch on the Baud Rate between Transmitter and Receiver. So I have two questions:&lt;BR /&gt;&lt;BR /&gt;1. Do I need to deal the the Trim Values or does CW take care of that?&lt;BR /&gt;2. What is the simplest method to measure the Internal Bus Clock? (9.216 MHZ)&lt;BR /&gt;&lt;BR /&gt;Thanks So Much!&lt;BR /&gt;David&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 23:03:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140740#M5734</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2007-07-23T23:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140741#M5735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi David,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Your code should check for framing errors, then you could be pretty sure you have a mismatch. Also depending on what else the QG8 is doing you could be missing characters.&lt;/DIV&gt;&lt;DIV&gt;What happens if you slow the baudrate?&lt;/DIV&gt;&lt;DIV&gt;CW should handle the TRIM if it is set to do so.&lt;/DIV&gt;&lt;DIV&gt;One method to confirm baudrate is to get the SCI to output continuous stream of 'A''s. This gives a square wave you can check for timing.&lt;/DIV&gt;&lt;DIV&gt;Otherwise write a little port pin toggle programme and measure the frequency of the pin.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Are you completely missing chars of are some garbled?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 03:46:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140741#M5735</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-07-24T03:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140742#M5736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi David (both of you),&lt;BR /&gt;&lt;BR /&gt;If you are missing every other byte, I would not suspect the baud rate. I would suspect something wrong within the SCI driver firmware.&lt;BR /&gt;&lt;BR /&gt;Are you disabling the transmitter or receiver at any time other than initialization? Are you running polled or interupt driven? Are you getting overrun errors? How about framing errors?&lt;BR /&gt;&lt;BR /&gt;Maybe if we could look at the code . . .&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 04:01:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140742#M5736</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2007-07-24T04:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140743#M5737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi Peg and Rocco,&lt;BR /&gt;&lt;BR /&gt;I have posted my SCI ISR code below, now I am toggling a pin (PTB6) to scope when the ISR is executed.&lt;BR /&gt;Also, the SCI Interrupt is the only interrupt source. The only other code running is loading the SPI register and now I bypassed that as well just in case. The scope shows a pulse (PTB6) on every byte received so the ISR is executing on every byte, so my problem must be somewhere else in the code.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help!&lt;BR /&gt;David&lt;BR /&gt;&lt;BR /&gt;** ===================================================================&lt;BR /&gt;**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interrupt handler : isrVscirx&lt;BR /&gt;**&lt;BR /&gt;**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description :&lt;BR /&gt;**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; User interrupt service routine.&lt;BR /&gt;**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Parameters&amp;nbsp; : None&lt;BR /&gt;**&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Returns&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : Nothing&lt;BR /&gt;** ===================================================================&lt;BR /&gt;*/&lt;BR /&gt;__interrupt void isrVscirx(void)&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp; /* Write your interrupt code here ... */&lt;BR /&gt;&amp;nbsp; if(SCIS1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Acknowledge Receiver Full Flag&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBD_PTBD6 = ~PTBD_PTBD6; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp_data = SCID; // Read the Data Buffer&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBD_PTBD6 = ~PTBD_PTBD6; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;/* end of isrVscirx */&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 05:58:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140743#M5737</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2007-07-24T05:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140744#M5738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi David,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Your simple ISR does not achieve a great deal as you just write the recieved data to one variable.&lt;/DIV&gt;&lt;DIV&gt;If your main loop does not service this variable at a rate greater than the byte rate&amp;nbsp;then you will still lose the byte. So you may as well just poll for the recieved byte. If this is the case then slowing down the baudrate as a test will find this out.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Also I was presuming you are running the same code that you were before when you had this going before at 38400 baud. Is this the case?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Remember, 4MHz PC's used to be able to run 115kbaud serial ports.&lt;/DIV&gt;&lt;DIV&gt;Nowadays 2GHz ones require the help of a hardware FIFO buffer to be able to cope with much less than this.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by peg on &lt;SPAN class="date_text"&gt;2007-07-24&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;10:35 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 19:28:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140744#M5738</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-07-24T19:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140745#M5739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi Peg,&lt;BR /&gt;&lt;BR /&gt;Yes, indeed, I changed the ISR to simply grab the received character. I wanted to make sure there was no problem with a mismatch between transmitter and receiver at the 115,200 Baud Rate. I am actually receiving 96 bytes and putting each one in a buffer with a pointer. The ISR is doing the following:&lt;BR /&gt;&lt;BR /&gt;1. Copy received byte to a buffer&lt;BR /&gt;2. Maintain Bytes Received Counter&lt;BR /&gt;3. Maintain Pointer increment and reset&lt;BR /&gt;&lt;BR /&gt;Now that I have a pin toggle in the ISR, I can see how long the execution takes. I don't think the time spent is too long in the ISR and I have not optomized the code yet, but I shall see. Also, I am actually using a double buffer scheme for now. ie. Copy 96 incoming bytes to Buffer1 then copy the next 96 bytes to Buffer2 and keep alternating. When I ran at 38400 BAUD, the application perfomed OK.&lt;BR /&gt;&lt;BR /&gt;I will post the results of my next test. I probably have some timing issues with the application. Also, adding some code for error checking would be a good thing.&lt;BR /&gt;&lt;BR /&gt;Also, I have not kept up with Serial Communications on the 2 GHZ machines. Can you elaborate on this?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;David&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 20:30:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140745#M5739</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2007-07-24T20:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140746#M5740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi Peg,&lt;BR /&gt;&lt;BR /&gt;Well, I am bit puzzled at this point as I added some code in the SCI ISR to check for the value of the received character. Also, the code in main() has been shortened to a simple for(;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt; loop and the COP is disabled.&lt;BR /&gt;At 115,200 BAUD I can detect the character 0x55, but not 0x54 and the transmitter is sending one character at a time. Normally, two pulses are seen on the scope, but when I transmit 0x54, the output pin does not generate two pulses even though the ISR has been executed. BTW, the scope shows the period of one bit at 115,200 BAUD to be 8.7 uS.&lt;BR /&gt;&lt;BR /&gt;ISR Code:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; if(SCIS1)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Acknowledge Receiver Full Flag&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBD_PTBD6 = ~PTBD_PTBD6;&amp;nbsp; //toggle pin&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tmp_data = SCID; // Read the Data Buffer&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBD_PTBD6 = ~PTBD_PTBD6;&amp;nbsp; //toggle pin&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tmp_data == 0x55)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBD_PTBD6 = ~PTBD_PTBD6;&amp;nbsp; //toggle pin&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCI_COUNTER = 0; // short delay between pin transistions&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTBD_PTBD6 = ~PTBD_PTBD6;&amp;nbsp; //toggle pin&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;Now if I change the code to check for 0x54, and send a 0x54 from the transmitter, the second pulse does not occur. I wonder why changing 1 bit in the character causes this effect?&lt;BR /&gt;&lt;BR /&gt;Still investigating ...&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;David&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 01:17:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140746#M5740</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2007-07-25T01:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140747#M5741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello David,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Yes, at 115200 baud the bit period will be 8.7us, however the transmission period for one &lt;U&gt;byte&lt;/U&gt; will be about 87 us.&amp;nbsp; So if a&amp;nbsp;continuous transmission of characters is received, you should observe a gap of 87 us between pulses at PTBD6.&amp;nbsp; If the gap is twice as long, this would demonstrate the loss of alternate characters.&amp;nbsp; Is this what you observe?&amp;nbsp; Assuming a bus frequency of 9.216 MHz, the byte transmission period actually represents 800 cycles, so you are looking for processing delays of more than this amount.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Another test to confirm how many characters you are losing would be to immediately&amp;nbsp;echo&amp;nbsp;back each received character, within the ISR code.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;You do not mention whether you checked for framing errors.&amp;nbsp; If there are still baud rate accuracy problems (due to oscillator trimming issues), framing errors would be probable.&amp;nbsp; Character dependent errors do suggest there might be a problem in this area.&amp;nbsp; You might try the character value 0x40 to exacerbate the problem even further.&amp;nbsp; This contains a run of seven bits with zero value.&amp;nbsp; The 0x54 character has a run of three bits to produce bit timing errors.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 02:23:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140747#M5741</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-07-25T02:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140748#M5742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi Bigmac,&lt;BR /&gt;&lt;BR /&gt;When transmitting 0xFF characters, the timing is 87 us between pulses. When transmitting 0x40, the problem is worse. I am missing one out of 4 characters sent and the time between pulses is about 108 us.&lt;BR /&gt;This indicates to me that the receiver is looking for more transitions before a character is actually received.&lt;BR /&gt;&lt;BR /&gt;I have not added the error checking code yet.&lt;BR /&gt;&lt;BR /&gt;Also, the TX pin is used for GPIO. I could change the config to TX output and scope it for timing.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;David&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 02:58:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140748#M5742</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2007-07-25T02:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140749#M5743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Bigmac,&lt;BR /&gt;&lt;BR /&gt;The TX output bit period is 26 us, that sure explains the problem! (about 3 times longer than it should be)&lt;BR /&gt;How can CW be so far off in setting the trim value?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;David&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 03:22:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140749#M5743</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2007-07-25T03:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140750#M5744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Bigmac,&lt;BR /&gt;&lt;BR /&gt;Forget about the last post, I made an error in the setting. The bit period on the TX output is 10 us, when it shoud be 8.7us. So the Bus Freq is running on the slow side.&lt;BR /&gt;Now that's a better explanation and it makes sense! The 26us period was way too far off to make any sense.&lt;BR /&gt;&lt;BR /&gt;Now I just need to figure out how to calibrate the trim.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;David&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 03:31:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140750#M5744</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2007-07-25T03:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140751#M5745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;So the problem is one of mismatched baudrate! (random post rater take note!)&lt;/DIV&gt;&lt;DIV&gt;The byte $55 is the easiest to get through on a mis-matched baudrate as it is a square wave and all those falling edges re-synch the reciever sampler.&lt;/DIV&gt;&lt;DIV&gt;Why not do like Mac suggested, in the isr, just&amp;nbsp; tx the byte back out, now you can scope both tx and rx at the same time and compare - no silly errors reading the timebase etc.&lt;/DIV&gt;&lt;DIV&gt;Check your code for a write to the TRIM register.&lt;/DIV&gt;&lt;DIV&gt;Got to go now.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 04:15:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140751#M5745</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-07-25T04:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140752#M5746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Following on from my previous post....&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Note that the programmer will calculate and programme a trim value into flash if you ask it to. However this value needs to be copied across into the working trim register at runtime by your code (or some generated by Codewarrior). You need to check that both of these steps are occurring.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My point with the fast modern PC was that at higher baudrates and no buffers you need to be careful about how often you service the serial port. With Windows etc a modern PC is much busier than before and even with the phenominal speed increases still struggles to keep up with high baudrates that could be done before when little else other than one programme was running.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 09:41:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140752#M5746</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-07-25T09:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140753#M5747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;It is also possible that the programmer is calibrating the internal oscillator for a "default" frequency that is&amp;nbsp;less than the required 36 kHz.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Note that, when a character value of 0xFF is sent, there should not be&amp;nbsp;framing errors, even&amp;nbsp;with severe baud rate errors.&amp;nbsp; This is&amp;nbsp;because all data bit values are the same state&amp;nbsp;as the stop bit.&amp;nbsp; This character value is not really suitable for testing purposes.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 10:55:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140753#M5747</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-07-25T10:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140754#M5748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Mac,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I meant to touch on this, about the 36kHz. The OP said "I set the Internal Clock Freq to 36 KHZ". I am not sure where this setting is made (PE?).&lt;/DIV&gt;&lt;DIV&gt;The P&amp;amp;E programmer calculates the trim for 31.250kHz so maybe they fiddle it for about 36 when they move it from the NV register to the working one. I don't know!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 11:39:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140754#M5748</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-07-25T11:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140755#M5749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi Bigmac and Peg,&lt;BR /&gt;&lt;BR /&gt;I tried a few values in the TRIM register, it turns out that 0x7C results in the TX output bit period to be very close to 8.7 us. I reran the test using 0x40 value characters from the transmitter and it works great!!&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;I found Peg's comment very interesting about the receiver re-synch, I was not aware of this.&lt;BR /&gt;&lt;FONT color="#6633FF"&gt;"The byte $55 is the easiest to get through on a mis-matched baudrate as it is a square wave and all those falling edges re-synch the reciever sampler."&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I am now working on how to auto calibrate the ICS.&lt;BR /&gt;&lt;BR /&gt;Out of curiosity, I tried to find where the NV_ICSTRM_INITVAL is actually initialized in Flash (0xFFAF), but so far I have only found the following Tip and #define in the MC9S08QG8.h file.&lt;BR /&gt;&lt;BR /&gt;/* Tip for register initialization in the user code:&amp;nbsp; const byte NV_ICSTRM_INIT @0x0000FFAF = &amp;lt;NV_ICSTRM_INITVAL&amp;gt;; */&lt;BR /&gt;#define _NV_ICSTRM (*(const NV_ICSTRMSTR * __far)0x0000FFAF)&lt;BR /&gt;&lt;BR /&gt;I looked through the startup code as well.&lt;BR /&gt;&lt;BR /&gt;Thanks so much for your help!&lt;BR /&gt;David&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 21:46:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140755#M5749</guid>
      <dc:creator>datamstr</dc:creator>
      <dc:date>2007-07-25T21:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: QG8 Higher Baud Rates</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140756#M5750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi David&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You won't find an initialisation of NVTRIM($FFAE:FFAF) it is determined and programmed by the programmer irrespective of the code being programmed into the device (if enabled to do so). You will only find (hopefully) code to move these values into $3B:3A.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Where did you specify that you wantes 36kHz?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;David&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2007 04:48:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/QG8-Higher-Baud-Rates/m-p/140756#M5750</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-07-26T04:48:41Z</dc:date>
    </item>
  </channel>
</rss>

