LoginSignup
0
0

More than 1 year has passed since last update.

LPC812で800KHzを作る

Last updated at Posted at 2022-09-06

x なぜかまちがっている

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

目的
GPIOのテスト




//GPIO_800KHz_812_1

#include "mbed.h"


//         TX    RX
//Serial pc(P0_4, P0_0); //812


//GPIOA->ODR    7,995Mhz 010

DigitalOut myled(P0_7);

#define io_def 0x80

//             654321009876543210
#define on1    0b0000000010000000
#define off1   0b0000000000000000

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

    //__disable_irq(); // disable interrupt
    //__enable_irq(); // enable interrupt

    //pc.printf("%x\r\n", (LPC_GPIO_PORT->DIR0) ); //0x80

    //GPIO bkup
    //int ii  = LPC_GPIO_PORT->DIR0;

//    //                        1234567890123456
//    int on1  = LPC_GPIO_PORT->DIR0 | 0b0000000000010000;
//    int off1 = LPC_GPIO_PORT->DIR0 & 0b1111111111101111;


//while(1){}


   //1:1
    while(1) {


        LPC_GPIO_PORT->DIR0 = on1;
        LPC_GPIO_PORT->DIR0 = on1;
        LPC_GPIO_PORT->DIR0 = on1;
        LPC_GPIO_PORT->DIR0 = on1;
        
        LPC_GPIO_PORT->DIR0 = on1;
        LPC_GPIO_PORT->DIR0 = on1;
        LPC_GPIO_PORT->DIR0 = on1;
        LPC_GPIO_PORT->DIR0 = on1;

        LPC_GPIO_PORT->DIR0 = on1;
        LPC_GPIO_PORT->DIR0 = on1;
        LPC_GPIO_PORT->DIR0 = on1;
        
        
        

        LPC_GPIO_PORT->DIR0 = off1;
        LPC_GPIO_PORT->DIR0 = off1;
        LPC_GPIO_PORT->DIR0 = off1;
        LPC_GPIO_PORT->DIR0 = off1;

        LPC_GPIO_PORT->DIR0 = off1;
        LPC_GPIO_PORT->DIR0 = off1;
        LPC_GPIO_PORT->DIR0 = off1;
        LPC_GPIO_PORT->DIR0 = off1;

        LPC_GPIO_PORT->DIR0 = off1;
        LPC_GPIO_PORT->DIR0 = off1;
        LPC_GPIO_PORT->DIR0 = off1;


    }//while


// 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 

/*
   //0.3us 800khz
    while(1) {




    }//while
*/


// 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

/*
   //1us 800khz
    while(1) {



    }//while
*/


}//main





o_con833.jpg

-13-

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