hcn你好,怎樣添加你們的庫呢?不是把CH375HFB.A添加到文件里,把CH375HFB.H添加到頭文件里嗎?請指教!?。。。。。。≈x謝了?。?!
(1)庫添加的方法和.C文件一樣 (2)頭文件不用加,在編譯時會自動包含 (3)本主題第一貼中有圖片:http://wch.cn/bbs/View.asp?S=101&I=1511
SCM謝謝了,我確實(shí)是那樣加的,我又看了下我的ICCAVR版本號是ICCAVR6.25版本,和這個有關(guān)系嗎,另外給的例程適合ATMega16嗎
我把.C文件里的#include "CH375HFB.H"屏蔽掉,則出現(xiàn)如下錯誤: C:\icc\bin\imakew -f USB.mak iccavr -c -IC:\icc\include\ -e -DATMEGA -l -g -Mavr_enhanced C:\icc\examples.avr\USB\CH375HFT.C !E C:\icc\examples.avr\USB\CH375HFT.C(57): undeclared identifier `UINT8' !W C:\icc\examples.avr\USB\CH375HFT.C(57):[warning] expression with no effect elided !E C:\icc\examples.avr\USB\CH375HFT.C(57): syntax error; found `i' expecting `;' !E C:\icc\examples.avr\USB\CH375HFT.C(57): undeclared identifier `i' !W C:\icc\examples.avr\USB\CH375HFT.C(57):[warning] expression with no effect elided !E C:\icc\examples.avr\USB\CH375HFT.C(68): syntax error; found `mCmd' expecting `)' !E C:\icc\examples.avr\USB\CH375HFT.C(68): skipping `mCmd' !E C:\icc\examples.avr\USB\CH375HFT.C(73): undeclared identifier `mCmd' !E C:\icc\examples.avr\USB\CH375HFT.C(83): syntax error; found `mData' expecting `)' !E C:\icc\examples.avr\USB\CH375HFT.C(83): skipping `mData' !E C:\icc\examples.avr\USB\CH375HFT.C(86): undeclared identifier `mData' !E C:\icc\examples.avr\USB\CH375HFT.C(95): syntax error; found `xReadCH375Data' expecting `;' !W C:\icc\examples.avr\USB\CH375HFT.C(97):[warning] expression with no effect elided !E C:\icc\examples.avr\USB\CH375HFT.C(97): syntax error; found `mData' expecting `;' !E C:\icc\examples.avr\USB\CH375HFT.C(97): undeclared identifier `mData' !W C:\icc\examples.avr\USB\CH375HFT.C(97):[warning] expression with no effect elided !E C:\icc\examples.avr\USB\CH375HFT.C(114): syntax error; found `ms' expecting `)' !E C:\icc\examples.avr\USB\CH375HFT.C(114): skipping `ms' !E C:\icc\examples.avr\USB\CH375HFT.C(116): undeclared identifier `UINT16' !W C:\icc\examples.avr\USB\CH375HFT.C(116):[warning] expression with no effect elided !E C:\icc\examples.avr\USB\CH375HFT.C(116): syntax error; found `i' expecting `;' !E C:\icc\examples.avr\USB\CH375HFT.C(116): undeclared identifier `i' !W C:\icc\examples.avr\USB\CH375HFT.C(116):[warning] expression with no effect elided !E C:\icc\examples.avr\USB\CH375HFT.C(117): undeclared identifier `ms' !E C:\icc\examples.avr\USB\CH375HFT.C(121): syntax error; found `iError' expecting `)' !E C:\icc\examples.avr\USB\CH375HFT.C(121): skipping `iError' !E C:\icc\examples.avr\USB\CH375HFT.C(123): too many errors C:\icc\bin\imakew.exe: Error code 1 C:\icc\bin\imakew.exe: 'CH375HFT.o' removed. Done: there are error(s). Exit code: 1
(1)例程是Mega64,Mega16程序空間有點(diǎn)緊,需要刪減主程序 (2)與編譯器可能也有關(guān)系,你用6.31的試試,我們沒有6.25編譯器 (3)CH375HFB.H不可屏蔽,里面有許多定義,如“UINT8”等
SCM你好,我可能太笨了吧,好幾天了,還是不行。我用了ICCAVR6.31還不行,我是把.C文件和CH375HFB.A放在同一目錄下,然后加上結(jié)果出現(xiàn)一下錯誤, C:\icc\bin\imakew -f USB1.mak iccavr -o USB1 -LC:\icc\lib\ -g -Wl-W -bfunc_lit:0.0x2000 -dram_end:0x25f -bdata:0x60.0x25f -dhwstk_size:16 -fihx_coff -S2 @USB1.lk C:\icc\examples.avr\CH375HFB.A want size 11674 lo 6302 hi 8192 size 1891 !E (3126): area 'text' not large enough want size 2590 lo 594 hi 607 size 14 !E (3126): area 'bss' not large enough want size 78 lo 594 hi 607 size 14 !E (3126): area 'bss' not large enough want size 25 lo 594 hi 607 size 14 !E (3126): area 'bss' not large enough C:\icc\bin\imakew.exe: Error code 1 Done: there are error(s). Exit code: 1 我還不明白,怎么每次都不一樣呢,這個錯誤提示是什么意思呢,感謝,感謝??!
這是空間不夠,選ATMega64試試
謝謝了SCM,剛才我選了ATMega128通過了,謝謝你,下一步該實(shí)驗(yàn)了,另外問你一個題外的問題,在ICCAVR中不能用位操作的即不能直接寫成PORTB.0=0;我聽人說有能用直接位操作的編譯器,您知道是哪種嗎?再次表示感謝!有時間來保定做客吧?。?!
謝謝SCM,剛才我選了Mega128通過了,下來該做試驗(yàn)了,這個程序能讀寫多少種U盤呢,另外問您個題外問題,我想對I/O口直接位操作PORTB.0=0;這種寫法,該用哪種編譯器呢,ICCAVR不行啊,再次感謝!歡迎來保定做客!
AVR不像51,好像不能位定義,具體的我也不清楚,GCC中也不可以,只剩下IAR了,不過我沒用過,感興趣的話,你可以去試試。 有時間去啊,呵呵!
SCM你好請教個問題再,咱們的例程都是用的并行吧,有沒有用串行的例程呢
用CH375ILIB5,下面有例子程序.串口的讀寫子函數(shù)屏蔽了,您參考一下.
紅桃六你好,下面的例程是51的嗎,有AVR的嗎,我開始接觸USB,懂的較少麻煩你了
AVR的你直接去下載CH375LIB。ZIP,里面有AVR的子程序庫