名称 |
MIRS1004 LEDボード詳細設計書② |
番号 |
MIRS1004-ELEC-0002 |
最終更新日:2011.1.21
版数 |
更新日 |
作成 |
承認 |
改訂記事 |
- |
2010.2.28 |
宮川 祐太 |
細越 寛太 |
原本 |
A01 |
2010.2.28 |
細越 寛太 |
細越 寛太 |
HTML化 |
目次
- 概要
- 変更点
- 結果
- 参考文献
- 概要
シリアルポートを追加し以下のプログラムを実行した。
そのためにuss.hの中身を少し変更し別名で使用する。
- 変更点
pic.h>>
**********************************************************************
//uss_func define
#define _POSIX_SOURCE 1 /* POSIX comliant source (POSIX準拠のソース)*/
//#define BAUDRATE B9600
//uss_get define
/*
#define STX 0x02
#define ETX 0x03
#define ENQ 0x05
#define ACK 0x06
#define LF 0x0a
#define CR 0x0d
#define NAK 0x15
*/
#define S_PORT "/dev/ttyS1"
**********************************************************************
pic_send.c>>
**********************************************************************
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
#include <termios.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <pthread.h>
#include "../main/func_extern.h"
#include "../main/control.h"
#include "../pic_led/pic.h"
void pic_led(int code);
int main(){
while(1){
pic_led(1);
printf("SENDING\n");
usleep(100000);
}
return 0;
}
**********************************************************************
- 結果
結果以下の出力をオシロスコープで検出することができた。

ADM3202は460 kbpsのデータ・レートであるため
pic16f84aで信号を1bitずつ読むことができると考えた。
しかしアセンブラのプログラムを作成するに至らなかった。
以下にシリアル通信を行うために作成した回路(超音波の親機の回路を参考にした)
ものとPICの回路を以下にのせる。




- 参考文献
沼津工業高等専門学校 電子制御工学科