<?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>MCUXpresso SDKのトピックRe: FRDM K66F-UART Module Configuration</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/FRDM-K66F-UART-Module-Configuration/m-p/1037517#M2224</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FreeRTOS driver is a wrapper based on uart driver.&lt;/P&gt;&lt;P&gt;I would suggest you add the bitCountPerChar feature in function UART_GetDefaultConfig. ( fsl_uart.c)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt;&amp;nbsp;* @brief Gets the default configuration structure.&lt;BR /&gt;&amp;nbsp;*&lt;BR /&gt;&amp;nbsp;* This function initializes the UART configuration structure to a default value. The default&lt;BR /&gt;&amp;nbsp;* values are as follows.&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;baudRate_Bps = 115200U;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;bitCountPerChar = kUART_8BitsPerChar;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;parityMode = kUART_ParityDisabled;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;stopBitCount = kUART_OneStopBit;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;txFifoWatermark = 0;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;rxFifoWatermark = 1;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;idleType = kUART_IdleTypeStartBit;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;enableTx = false;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;enableRx = false;&lt;BR /&gt;&amp;nbsp;*&lt;BR /&gt;&amp;nbsp;* @param config Pointer to configuration structure.&lt;BR /&gt;&amp;nbsp;*/&lt;BR /&gt;void UART_GetDefaultConfig(uart_config_t *config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 29 Mar 2020 10:13:52 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2020-03-29T10:13:52Z</dc:date>
    <item>
      <title>FRDM K66F-UART Module Configuration</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/FRDM-K66F-UART-Module-Configuration/m-p/1037516#M2223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Morning Community,&lt;/P&gt;&lt;P&gt;we want to use a K66f as a gateway between a serial communication and MQTT.&lt;/P&gt;&lt;P&gt;Therefore we combined the examples "frdmkff6_lwip_mqtt_freertos" and "frdmk66f_freertos_uart" from SDK 2.7.0.&lt;/P&gt;&lt;P&gt;Everything works fine except the configuration of the UART Module for our needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The serial data structure we are using is as follows:&lt;/P&gt;&lt;P&gt;Start Bit, 7 data bit, even parity bit, two stop bits.&lt;/P&gt;&lt;P&gt;Single characters shall be transmitted and received sequentially.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the documentation of the K66f, we know that it can be configured to use 7 data bit-messages.&lt;/P&gt;&lt;P&gt;In other configurations, there is the possibility to set the bitCountPerChar but not in the freertos example.&lt;/P&gt;&lt;P&gt;I added the code snipplet (last line), but it can not be used when not commented out. We require a 7 data bit structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uart_rtos_config_t uart_config = {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .baudrate&amp;nbsp;&amp;nbsp;&amp;nbsp; = 1200,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .parity&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = kUART_ParityEven,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .stopbits&amp;nbsp;&amp;nbsp;&amp;nbsp; = kUART_TwoStopBit,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .buffer&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = background_buffer,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .buffer_size = sizeof(background_buffer),&lt;BR /&gt;/*.bitCountPerChar = kUART_7BitsPerChar,*/&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We tried to work around the problem by adjusting the register configuration in fsl_uart.c driver (last line). The information for the configuration comes from the document K66P144M180SF5RMV2, chapter 59.4.3:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Set bit count/parity mode/idle type. */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp = base-&amp;gt;C1 &amp;amp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ~((uint8_t)UART_C1_PE_MASK | (uint8_t)UART_C1_PT_MASK | (uint8_t)UART_C1_M_MASK | (uint8_t)UART_C1_ILT_MASK);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp |= UART_C1_ILT(config-&amp;gt;idleType);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (kUART_ParityDisabled != config-&amp;gt;parityMode)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp |= (UART_C1_M_MASK | (uint8_t)config-&amp;gt;parityMode);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //base-&amp;gt;C1 = temp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* edit to stop automatic assignment of 9-bit data length because of parity bit*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; base-&amp;gt;C1 = 0x02;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The controller seems not to accept this modification.&lt;/P&gt;&lt;P&gt;When the parity bit is set, the character is not correctly transmitted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we adapt the configuration to solve our problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance and best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2020 09:42:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/FRDM-K66F-UART-Module-Configuration/m-p/1037516#M2223</guid>
      <dc:creator>michael_schoeff</dc:creator>
      <dc:date>2020-03-17T09:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM K66F-UART Module Configuration</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/FRDM-K66F-UART-Module-Configuration/m-p/1037517#M2224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FreeRTOS driver is a wrapper based on uart driver.&lt;/P&gt;&lt;P&gt;I would suggest you add the bitCountPerChar feature in function UART_GetDefaultConfig. ( fsl_uart.c)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt;&amp;nbsp;* @brief Gets the default configuration structure.&lt;BR /&gt;&amp;nbsp;*&lt;BR /&gt;&amp;nbsp;* This function initializes the UART configuration structure to a default value. The default&lt;BR /&gt;&amp;nbsp;* values are as follows.&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;baudRate_Bps = 115200U;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;bitCountPerChar = kUART_8BitsPerChar;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;parityMode = kUART_ParityDisabled;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;stopBitCount = kUART_OneStopBit;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;txFifoWatermark = 0;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;rxFifoWatermark = 1;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;idleType = kUART_IdleTypeStartBit;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;enableTx = false;&lt;BR /&gt;&amp;nbsp;*&amp;nbsp;&amp;nbsp; uartConfig-&amp;gt;enableRx = false;&lt;BR /&gt;&amp;nbsp;*&lt;BR /&gt;&amp;nbsp;* @param config Pointer to configuration structure.&lt;BR /&gt;&amp;nbsp;*/&lt;BR /&gt;void UART_GetDefaultConfig(uart_config_t *config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Mar 2020 10:13:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/FRDM-K66F-UART-Module-Configuration/m-p/1037517#M2224</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2020-03-29T10:13:52Z</dc:date>
    </item>
  </channel>
</rss>

