hcn你好,怎样添加你们的库呢?不是把CH375HFB.A添加到文件里,把CH375HFB.H添加到头文件里吗?请指教!!!!!!!!谢谢了!!!
(1)库添加的方法和.C文件一样 (2)头文件不用加,在编译时会自动包含 (3)本主题第一贴中有图片:http://wch.cn/bbs/View.asp?S=101&I=1511
SCM谢谢了,我确实是那样加的,我又看了下我的ICCAVR版本号是ICCAVR6.25版本,和这个有关系吗,另外给的例程适合ATMega16吗
我把.C文件里的#include "CH375HFB.H"屏蔽掉,则出现如下错误: 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程序空间有点紧,需要删减主程序 (2)与编译器可能也有关系,你用6.31的试试,我们没有6.25编译器 (3)CH375HFB.H不可屏蔽,里面有许多定义,如“UINT8”等
SCM你好,我可能太笨了吧,好几天了,还是不行。我用了ICCAVR6.31还不行,我是把.C文件和CH375HFB.A放在同一目录下,然后加上结果出现一下错误, 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通过了,谢谢你,下一步该实验了,另外问你一个题外的问题,在ICCAVR中不能用位操作的即不能直接写成PORTB.0=0;我听人说有能用直接位操作的编译器,您知道是哪种吗?再次表示感谢!有时间来保定做客吧!!!
谢谢SCM,刚才我选了Mega128通过了,下来该做试验了,这个程序能读写多少种U盘呢,另外问您个题外问题,我想对I/O口直接位操作PORTB.0=0;这种写法,该用哪种编译器呢,ICCAVR不行啊,再次感谢!欢迎来保定做客!
AVR不像51,好像不能位定义,具体的我也不清楚,GCC中也不可以,只剩下IAR了,不过我没用过,感兴趣的话,你可以去试试。 有时间去啊,呵呵!
SCM你好请教个问题再,咱们的例程都是用的并行吧,有没有用串行的例程呢
用CH375ILIB5,下面有例子程序.串口的读写子函数屏蔽了,您参考一下.
红桃六你好,下面的例程是51的吗,有AVR的吗,我开始接触USB,懂的较少麻烦你了
AVR的你直接去下载CH375LIB。ZIP,里面有AVR的子程序库