欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: ATMEGA64的串口通信 用串口助手讀取不了數(shù)據(jù)? [打印本頁]

作者: LLLLLLLL123231    時間: 2018-8-27 14:51
標題: ATMEGA64的串口通信 用串口助手讀取不了數(shù)據(jù)?
用的USB轉TTL接口,直接rxtx交叉連接,只連接2根線。為什么用串口助手讀取不了數(shù)據(jù)?以下是程序:

  1. #include <iom64v.h>
  2. #include <macros.h>
  3. #include <stdio.h>

  4. #define uchar unsigned char
  5. void uart0_init(void)
  6. {
  7.          UCSR1B = 0x00;
  8.          UCSR1A = 0X00;
  9.          UCSR1C = (1 << UCSZ11) | (1 << UCSZ10);
  10.          UBRR1L = 12;
  11.          UBRR1H = 0x00;
  12.          UCSR1B = (1 << RXEN1) | (1 << TXEN1);
  13. }

  14. void rs232send(uchar c)
  15. {
  16.          while(!(UCSR1A&(1 << UDRE1)));
  17.          UDR1 = c;
  18. }

  19. /*void puts0 (char *s)
  20. {
  21.          while(*s)
  22.          {
  23.                      rs232send(*s);
  24.                    s++;
  25.          }
  26.          rs232send(0x0a);
  27.          rs232send(0x0d);
  28. }*/
  29. void main (void)
  30. {
  31.          uart0_init();
  32.         // puts0("hello");
  33.          rs232send(2);
  34.          while(1)
  35.          {
  36.                            //puts0 ("test ok");
  37.          }
  38. }
復制代碼



作者: LLLLLLLL123231    時間: 2018-8-27 16:00
是硬件問題還是程序問題?usb轉TTL不靠譜的嗎???頭快炸了呀=-=
作者: LLLLLLLL123231    時間: 2018-8-28 08:41
沒人幫幫忙的嗎




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1