• 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: 關於CCS COMPILER問題?
#4
資深會員
資深會員


查看用戶資訊
參照:

mickeys_wu 寫道:
再請問一下,stream=high_speed這個是指把BRGH設為1嗎?謝謝
不是,stream 指的是設備代號以及其通訊設定

#use rs232(baud=4800,xmit=pin_a3,rcv=pin_a4,stream=GPS)
#use rs232(baud=4800,xmit=pin_b1,rcv=pin_b2,stream=PIC_2)
#use rs232(baud=4800,xmit=pin_c6,rcv=pin_c7,stream=PC)

main()
{
fprintf(PC, "test_123"); // 傳給 PC

fprintf(PIC_2, "test_456"); // 傳給 PIC_2

c = fgetc(GPS); //接收 GPS

用 help 看看吧

發表於: 2004/9/24 9:55
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於CCS COMPILER問題?
#3
資深會員
資深會員


查看用戶資訊
再請問一下,stream=high_speed這個是指把BRGH設為1嗎?謝謝

發表於: 2004/9/24 0:21
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於CCS COMPILER問題?
#2
資深會員
資深會員


查看用戶資訊
有三招,
第一招,用 CCS 的函數,看你的版本夠不夠新
A new function has been added: SETUP_UART that works the same as SET_UART_SPEED.
A new feature of this function is when a FALSE (or 0) is passed it turns off the UART
and when a TRUE (or 1) is passed in it turns the UART on. Passing in a baud rate also
turns on the UART.

第二招,直接硬幹
#byte SPBRG = 0xFAF // 18F452 的鮑率 暫存器
RS232_baud_rate_code = 21; // 42 for 57600 baud rate
// 21 for 115200 @ 40 MHz
// 9 for 250000

SPBRG = RS232_baud_rate_code; // 寫入暫存器,隨你改鮑率設定

第三招,沒玩過,不太確定

#use rs232(baud=19200,xmit=pin_c6,rcv=pin_c7,stream=high_speed)

#use rs232(baud=9600,xmit=pin_c6,rcv=pin_c7,stream=low_speed)

#use rs232(baud=4800,xmit=pin_c3,rcv=pin_c4,stream=GPS)

main()
{
fprintf(high_speed, "test_123");

delay_ms(200);

fprintf(low_speed, "test_456");

發表於: 2004/9/23 22:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於CCS COMPILER問題?
#1
資深會員
資深會員


查看用戶資訊
想請問各位,如果在CCS裡已設定了鮑率,可以在某段程式裡再更改鮑率成9600嗎?謝謝~
#use rs232(baud=19200, xmit=PIN_C6, rcv=PIN_C7)

發表於: 2004/9/23 20:49
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... ]

教育訓練中心

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