<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # UART操作 ## 基礎操作 首先在dts里使能UART: ~~~ sun8i-v3s.dtsi: uart0_pins_a: uart0@0 { pins = "PB8", "PB9";function = "uart0";bias-pull-up; }; uart1_pins_a: uart1@0 { pins = "PE21", "PE22";function = "uart1";bias-pull-up; }; uart2_pins_a: uart2@0 { pins = "PB0", "PB1";function = "uart2";bias-pull-up; }; sun8i-v3s-licheepi-zero.dts: &uart0 { pinctrl-0 = <&uart0_pins_a>;pinctrl-names = "default";status = "okay"; }; &uart1 { pinctrl-0 = <&uart1_pins_a>;pinctrl-names = "default";status = "okay"; }; &uart2 { pinctrl-0 = <&uart2_pins_a>;pinctrl-names = "default";status = "okay"; }; ~~~ 然后啟動后就能看到ttyS0~ttyS2了 再使用常見串口軟件就能使用 ## 波特率分頻問題 為了串口通信穩定,一般要求波特率誤差在2.5%以內。 V3S的uart是掛在APB2下,而APB2時鐘是24M,所以對一些高速率的波特率,難以分頻到合適的頻率。 以921600為例,下面進行修改: 進入uboot的arch/arm/mach-sunxi/clock_sun6i.c,修改uart時鐘: ~~~ void clock_init_uart(void) { #if CONFIG_CONS_INDEX < 5 struct sunxi_ccm_reg *const ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; /* uart clock source is apb2 */ writel(APB2_CLK_SRC_OSC24M| //這里改為APB2_CLK_SRC_PLL6,從內部pll6時鐘分頻 APB2_CLK_RATE_N_1| //這里預分頻不變 APB2_CLK_RATE_M(1), &ccm->apb2_div); ~~~ pll6時鐘默認為600MHz,可以分出比較高的串口波特率。 600/0.9216/16=40.69, 舍入為41,相對誤差為0.75% 然后再修改include/configs/sunxi-common.h ~~~ /* ns16550 reg in the low bits of cpu reg */ #define CONFIG_SYS_NS16550_CLK 24000000 //這里改為600000000 #ifndef CONFIG_DM_SERIAL ~~~ 剩余的就是按照原有方法修改波特率了。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看