LoginSignup
0
0

More than 1 year has passed since last update.

LPC812MAXでソフトウェアシリアルを使い「A」を連続出力する(1000bps)

Last updated at Posted at 2022-09-02

x mbed2リビジョン144
x リビジョンの変更がわかる人むけ

目的
デバッグのテスト

出力先は、 P0_7 RED

o_con710.jpg

o_con709.jpg




//S_SER_A_A_A_812_1

#include "mbed.h"

//仮想シリアルへの一文字出力 1000bps
DigitalOut TX(P0_7);
#define UART_DELAY 1
void pc_putc(char ch)
{
    TX=1;
    TX=0;//Start
    wait_ms(UART_DELAY);

    for(int ii=0; ii<8; ii++) { //Data x 8
        TX=(ch>>ii)&1;
        wait_ms(UART_DELAY);
    }; //for

    TX=1;//Stop
    wait_ms(UART_DELAY);

} //pc_putc

//メイン関数
int main()
{

    //無限ループ
    while(1) {

        //'A'の出力
        pc_putc( 'A' );

        //1秒待つ
        wait_ms(1000);

    }//while

}//main



o_con833.jpg

-3-

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0