• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users




(1) 2 3 4 »


Re: 用c寫程式哪一套比較好
#31
資深會員
資深會員


查看用戶資訊
又有問題了
在CCS中

為什麼常用到printf 及fprintf
看不懂HELP中的解釋
到底用途在哪裡?

發表於: 2005/6/24 13:20
==== ^^ ^^ ====
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用c寫程式哪一套比較好
#30
資深會員
資深會員


查看用戶資訊
感謝mechwu的協助

我會加緊努力
突破困難

在此甘溫喔

PS:如有新資訊請多多贊助

發表於: 2005/6/24 9:00
==== ^^ ^^ ====
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用c寫程式哪一套比較好
#29
資深會員
資深會員


查看用戶資訊
ADC 的,就 Help -> Index -> Read_xxx

有 Read_ADC 也有 Read_EEPROM 還有 .... 一堆

先看看 Read_ADC() 吧 ... 有說明,有範例,不需要書啊 ...

其他的 ... 就依此類推囉 ...

還不夠? 就下載一本 CCS-C 使用手冊 K 囉

http://www.ccsinfo.com/ccscmanual.zip

http://www.ccsinfo.com/download.shtml

祝 如意

READ_ADC()


Syntax:
value = read_adc ([mode])



Parameters:
mode is an optional parameter. If used the values may be:

ADC_START_AND_READ (this is the default)

ADC_START_ONLY (starts the conversion and returns)

ADC_READ_ONLY (reads last conversion result)



Returns:
Either a 8 or 16 bit int depending on #DEVICE ADC= directive.



Function:
This function will read the digital value from the analog to digital converter. Calls to setup_adc(), setup_adc_ports() and set_adc_channel() should be made sometime before this function is called. The range of the return value depends on number of bits in the chips A/D converter and the setting in the #DEVICE ADC= directive as follows:

#DEVCE
8 bit
10 bit
11 bit
16 bit

ADC=8
00-FF
00-FF
00-FF
00-FF

ADC=10
x
0-3FF
x
x

ADC=11
x
x
0-7FF
x

ADC=16
0-FF00
0-FFC0
0-FFEO
0-FFFF


Note: x is not defined



Availability:
This function is only available on devices with A/D hardware.



Requires
#include <STDLIB.H>



Examples:
setup_adc( ADC_CLOCK_INTERNAL );

setup_adc_ports( ALL_ANALOG );

set_adc_channel(1);

while ( input(PIN_B0) ) {

delay_ms( 5000 );

value = read_adc();

printf("A/D value = %2x\n\r", value);

}



read_adc(ADC_START_ONLY);

sleep();

value=read_adc(ADC_READ_ONLY);



Example Files:
ex_admm.c, ex_14kad.c



Also See:
setup_adc(), set_adc_channel(), setup_adc_ports(), #DEVICE


發表於: 2005/6/23 18:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用c寫程式哪一套比較好
#28
資深會員
資深會員


查看用戶資訊
以上都要

外部訊號由PIC的ADC進來
再經分析存入EEPROM
在經74164 顯示在 LED DISPLAY
中間還一些判斷及輸出入I/O
最後I/O輸出訊號給外部DAC0832

謝謝

------------------------
HI-TECH PICC的 資料好像比較多
而CCS好像比較少
該怎麼辦呢



發表於: 2005/6/23 16:43
==== ^^ ^^ ====
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用c寫程式哪一套比較好
#27
資深會員
資深會員


查看用戶資訊

>> 只是CCS指令不懂

就直說你要啥吧

不然要我從哪裡開始說?

要 ADC 還是 PWM 做 DA ?

還是要 EEPROM ?

<CCS -> Help -> 有完整的指令介紹說明
>====>太多了 也不知從何下手

先全部瀏覽一遍吧,我也是這樣幹的

發表於: 2005/6/21 19:19
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用c寫程式哪一套比較好
#26
資深會員
資深會員


查看用戶資訊
甘溫mechwu

C語言當然會

只是CCS指令不懂

<CCS -> Help -> 有完整的指令介紹說明
>====>太多了 也不知從何下手

公司之前用16F877A組合語言開發產品
現在要增加功能 用組合語言有瓶頸

想要用C來凸破

目前有用到 1組ADC
掃描display 外掛74164
輸出DAC(用0832解碼)
還用到EEPROM
及一些LED顯示(用掃描顯示)
外加一些I/O腳做輸出入控制

甘溫喔





發表於: 2005/6/21 17:38
==== ^^ ^^ ====
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用c寫程式哪一套比較好
#25
資深會員
資深會員


查看用戶資訊
>> 只是C語法 C指令不知道

沒學過 C?

CCS -> Help -> 有完整的指令介紹說明

The C Programming Language, Second Edition
by Brian W. Kernighan and Dennis M. Ritchie.

這是 C 的聖經 http://cm.bell-labs.com/cm/cs/cbook/
先用 PC 的 Turbo-C 或 VC 玩玩吧
圖書館一定有,中文書也是一堆

上 Google 查 C 語言,一堆教學網站

Have fun !

發表於: 2005/6/21 17:15
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用c寫程式哪一套比較好
#24
資深會員
資深會員


查看用戶資訊
謝謝mechwu

我已經有買ICD2 及APP001
CCS灌好了外加MPLAB7.11

執行上次mechwu附的程式執行OK
下載至ICD2 模擬OK

只是C語法 C指令不知道
是否有電子檔 或資料
介紹指令用法

甘溫喔

發表於: 2005/6/21 16:39
==== ^^ ^^ ====
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用c寫程式哪一套比較好
#23
資深會員
資深會員


查看用戶資訊
1. 下載 CCS 試用版 http://www.ccsinfo.com/demo.shtml

2. 找範例 C:\Program Files\PICC\Examples\*.c

就從 LED 開始玩吧 EX_SQW.c

C:\Program Files\PICC\Examples\EX_SQW.c

3. 看書 http://www.ccsinfo.com/newtopiccbooks.shtml

4. 買套實驗板 http://www.ccsinfo.com/hardware.shtml#devkits
http://www.ccsinfo.com/evalkit877.shtml#16f877

這塊本土實驗板 Microchip General Purpose EVM Board (APP001) 非常好,台幣 1500,
http://www.microchip.com.tw/images0/evm-app001.JPG

沒板子的話,就玩模擬器吧,呵呵

5. 買套學生版的合法軟體, 50 美金就好,一堆範例http://www.ccsinfo.com/education.shtml

發表於: 2005/6/21 16:04
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 用c寫程式哪一套比較好
#22
資深會員
資深會員


查看用戶資訊
我已經灌好CCS了
但是在MPLAB7.0不能執行

之後上CCS討論區查詢

灌MPLAB7.11就可以用了

但是不知道CCS的語法是如何?

以及如何書寫CCS?

請各大俠協助

發表於: 2005/6/21 13:18
==== ^^ ^^ ====
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... ]

教育訓練中心

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