完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我使用的是CCS编译器。标准的方法I/O将导致编译器生成代码,以使I/O引脚每次使用时都能输入或输出。在5X处理器上,对于标准I/O.FixEddio IO的每一个端口,都需要一个字节的RAM。I/O的固定方法将导致编译器生成代码,以使I/O引脚每次使用时都能输入或输出。引脚根据本指令中的信息编程(而不是实际执行的操作)。这节省了标准I/O中使用的RAM字节。当连接多个编译单元时,该指令只适用于当前编译单元。例如:根据描述,编译器仍然会在这里生成一个StestTrasiA()函数吗?如果是这样,那么使用固定而不是允许它默认为标准有什么意义呢?我一定错过了一些东西。所有这些模式对我来说都很好,我只是不明白我预期的用途。
以上来自于百度翻译 以下为原文 I'm using CCS compiler. The details from their documentation are... STANDARD_IO FIXED_IO The description for Fixed seems counter intuitive. For example: #use FIXED_IO( A_outputs=PIN_A0 ) . . output_high(PIN_A0); According to the description, the compiler will still generate a set_tris_a() function here? If so, what's the point of using FIXED instead of allowing it to default to STANDARD? I must be missing something. All of these modes are working fine for me, I just don't understand the intended usage I guess. |
|
相关推荐
5个回答
|
|
我认为“.”的描述措辞非常糟糕。这只是一个猜测,您必须要求CCS编译器作者获得最终的词。CCS不是微芯片产品。我认为它们的意思是“使编译器每次使用时都生成代码来输入或输出I/O引脚”实际上是“将引脚固定为“输入”和“输出”,并且假设每次寻址时它仍然是相同的。也就是说,在初始化之后,它根本不接触TrIS寄存器。我同意你们的说法,它们的措辞含糊不清。
以上来自于百度翻译 以下为原文 I think the description of "fixed" is very poorly worded. This is just a guess, you would have to ask the CCS compiler authors to get the definitive word. CCS is not a Microchip product. What I think they mean by "cause the compiler to generate code to make an I/O pin either input or output every time it is used" is actually "fix the pin as just an "input" and just an "output", and assume it is still the same every time it is addressed. i.e. it does NOT touch the TRIS register at all after initialisation. I agree with you that their wording is ambiguous. |
|
|
|
固定的描述似乎违反直觉。例如:根据描述,编译器仍然会在这里生成一个StestTrasiA()函数吗?如果是这样,那么使用固定而不是允许它默认为标准有什么意义呢?我一定漏掉了什么东西。所有这些模式对我来说都很好,我只是不理解预期的用法。嗨,试试这个……在头文件中或者在m a in.c文件中的顶部:(例如:我正在使用与项目同名的头文件)#use FIXED_IO(A_outputs=PIN_A0)//只有一个引脚是一个固定的输出。如果您使用这个引脚,那么在声明中您就不会修复它。#define LED PIN_A0//这个引脚现在在程序代码中称为LED--//output_bit(LED,1);//现在这个引脚变高了//同样的是:output_bit(PIN_A0,1);-分号很重要。output_bit(LED,0);//现在这个引脚变高了。切换pin output_toggle(LED);//pintoggles._ms(500);...output_bit(LED,0);//pin停止切换,变低,请阅读手册。你也会在PICC Falds.www. CcSnFuff-论坛找到例子。你会发现很多帮助代码。
以上来自于百度翻译 以下为原文 The description for Fixed seems counter intuitive. For example: #use FIXED_IO( A_outputs=PIN_A0 ) . . output_high(PIN_A0); According to the description, the compiler will still generate a set_tris_a() function here? If so, what's the point of using FIXED instead of allowing it to default to STANDARD? I must be missing something. All of these modes are working fine for me, I just don't understand the intended usage I guess. Hi, try this... in your header file or at the top in your main.c file: (ex: I'm using a header file with the same name of the project) #use FIXED_IO(A_outputs=PIN_A0) // only one pin is a fixed output. If you use this pin also a an input you don't fix it in the declaration. #define LED PIN_A0 // this pin is now called LED -- //in the program code: output_bit(LED, 1); //now this pin goes to high // the same would be: output_bit(PIN_A0, 1); - semicolon is important .. output_bit(LED, 0); //now this pin goes to low output_bit(PIN_A0, 0); .. // toggle the pin output_toggle (LED); //the pin toggles delay_ms (500); ... output_bit(LED, 0); // the pin stops toggle, goes low, switch off Please read the manual. You'll find also examples in the PICC folders. www.ccsinfo.com - forum. You'll find a lot of helping codes. Gerald --- |
|
|
|
好的,我不使用CCS,以下只是基于几个快速搜索的猜测。使用STANDARD_IO,编译器将自动将pin更改为每个输入指令的输入和每个输出指令的输出。非常I/O操作;但是,它将方向设置为指定的值,而不是指令所暗示的值。使用FAST_IO,您负责配置TRIS。基于此,我认为我不希望使用CCS……太多了。我也不明白为什么需要一个字节的RAM &编辑…除非他们在没有内存映射的TIS寄存器的情况下讨论PIC设备?一个RAM用来充当TIS指令的影子。&编辑/gt;
以上来自于百度翻译 以下为原文 Okay, I don't use CCS and the following is just a guess based on a couple quick searches. With STANDARD_IO, the compiler will automatically change the pin to an input for every input instruction and to an output for every output instruction. With FIXED_IO, the compiler still configures the TRIS for every I/O operation; however, it sets the direction to the value you specify, rather than to the one the instruction implies. With FAST_IO, you are responsible for configuring the TRIS. Based on this, I don't think I would like CCS... too Arduino. I also don't understand why a byte of RAM is needed |
|
|
|
|
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5317 浏览 9 评论
2072 浏览 8 评论
1977 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3248 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2285 浏览 5 评论
831浏览 1评论
724浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
670浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
723浏览 0评论
619浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-2-1 03:04 , Processed in 1.852918 second(s), Total 83, Slave 67 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号