질문있으면 언제든 댓글달아주세요
http://nexp.tistory.com/category/?page=45
▲여러가지 카테고리들 중
▲휴대폰을 이용한 램프제어
http://nexp.tistory.com/1234
▲MSP430 Soft_UART 쌍방향 테스트
=============================================================================http://myfreetimehobbies.blogspot.kr/2012_10_01_archive.html
▲Example program using two UART (PIC16F877A기반)....(AVR에 맞춰서 코드를 수정했다.)
▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
/*This program inputs from on chip UART and output to Soft UART*/
char i, error, byte_read='1',uart_rd='1'; //Auxiliary variables
void main()
{
DDRB=0xFF; //원래코드:::TRISB = 0x00;.......Set PortB as Output (error signalization)
PORTB = 0; //Default Value
UART1_Init(9600); //통신속도
error = Soft_UART_Init(&PORTC,1,0,9600,0); //Initialize Soft_UART at 9600 bps
if(error > 0) //when erro=1, successful initialization
{
PORTB = error; //put the error result in PORTB variable
while(1);
}
Delay_ms(100);
UART1_Write_Text("Enter Text Here(0 to exit)");
do
{
if(UART1_Data_Ready())
{
UART1_Write(10);
UART1_Write(13);
uart_rd = UART1_Read();
Soft_UART_Write(uart_rd);
Delay_ms(100);
}
}
while(uart_rd!='0');
}
▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲▲
==================================================================
http://myfreetimehobbies.blogspot.kr/2012_10_01_archive.html
▲인터럽트 (PIC16F877A 기반)
▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
Code
'Communication(CAN, UART, etc)' 카테고리의 다른 글
Bluetooth 마스터 & 슬레이브 역할 바꾸는법 (3) | 2016.01.11 |
---|---|
Bluetooth 모듈내 통신속도 조절하는 프로그램 사용법 (0) | 2015.08.30 |
Rx Tx Echo text (에코테스트)----FTDI (0) | 2015.08.12 |
UART to USB communication (0) | 2015.06.14 |
All about CAN (0) | 2012.12.28 |