A/D source code for H8/3664F
Reports
This page includes Japanese characters

 Convert A/D and send to PC program
Ref [2] shows a source program to send A/D to PC, as follows with comments in Japanese,
    #include<3664.h>

    char txb[10], rxb[10];/* シリアル用グローバル変数 */

    void main()
    {
    SCI3_INIT(br9600,txb,sizeof(txb),rxb,sizeof(rxb)); /* シリアル初期化 */

    AD.ADCSR.BYTE = 0x38; /* 0011 1000*/
    /* A/D変換開始 */
    /* スキャンモード */
    /* 高速変換 */
    /* AN0 */

    EI; //割り込み許可

    while(1){
    while(AD.ADCSR.BIT.ADF==0); /* 変換結果がでるまで待つ */
    SCI3_PRINTF("A/D CONV = %4d\n",AD.ADDRA>>6); /*ビットシフト(6ずらす)*/
    AD.ADCSR.BIT.ADF=0; /* 終了フラグを0に戻す */
    } }
I will have to think the code to program for my purpose. I think that we should comment in roma-ji or alphabet, considering globalization. We, Japanese programmers owed source programs commented in English for long time.


Biwa Lake JAPAN   aboutMe
© 2012 Enoki Sensor All Rights Reserved