• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






Re: 10F202用CCS寫software UART
#3
資深會員
資深會員


查看用戶資訊
順帶一提,mechwu大大,CCS何時會支援PIC24和DSPIC系列呢?謝謝

發表於: 2006/10/8 18:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 10F202用CCS寫software UART
#2
資深會員
資深會員


查看用戶資訊
GPS 的 UART 是 TTL 準位還是 RS232 準位?
是 5V TTL 還是 3.3 V TTL ?
有加 MAX232 做準位轉換嗎?
CCS 的 #use rs232 用於 software UART 時可以選用 INVERT

INVERT
Invert the polarity of the serial pins (normally not needed when level converter, such as the MAX232). May not be used with the internal UART.

先確認準位吧

發表於: 2006/10/5 23:51
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


10F202用CCS寫software UART
#1
新會員
新會員


查看用戶資訊
10F202用CCS寫Software UART
程式如下
#include <10F202.h>
#fuses PROTECT,MCLR,NOWDT
#use delay(clock=4000000)

#use rs232(baud=9600,xmit=PIN_B2,rcv=PIN_B3,stream=GPS)
#use rs232(baud=38400,xmit=PIN_B0,rcv=PIN_B1,stream=PC)

char input;
void main()
{
delay_ms(255);
delay_ms(255);
fputs("ABC\r",GPS);
delay_ms(255);

while(1)
{
input = fgetc(PC);
if(input != 0)
{
fputc(input,GPS);
}
delay_ms(5);
}

發現程式可以正常送出"ABC"字串
但是Rx端沒收到任何東西
拿示波器一量,發現整個電壓都被拉下去了,不是5V
難怪沒收到
我試著寫組語去設定TRIS,但是還是無效
我用CCS的INPUT_STATE()指令去看IO的狀態
竟然發現B2為1、B0,B1,B3為0
但是B2明明可以很順利的輸出字串,應該是Output mode啊,怎麼會是1哩

請問是CCS的支援問題還是我有初始設定露掉了哩?

發表於: 2006/10/4 14:52
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------