完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
|
海朋友,TRISB=0XFF;PORTB=0XFF;TRSIC=0X00;PORTC=0X00;通过这种方式,只有我学会了配置端口……但是我怀疑我们是否可以像下面这样配置。彼此之间有什么区别?TrISB= 0xFF;PORTB= 0x00;TrISC= 0x00;TrSiC= 0xFF;
以上来自于百度翻译 以下为原文 Hai friends, TRISB=0XFF; PORTB=0XFF; TRSIC=0X00; PORTC=0X00; by this way only I learned to config the ports.. But i had an doubt wheather we can config like below..?and what is the difference between each other..? TRISB=0XFF; PORTB=0X00; TRISC=0X00; TRSIC=0XFF; |
|
相关推荐
19个回答
|
|
|
你的问题不是很明显。你拼错了TRISC两次。你把“PORTB=0XFF;”改成了“PORTB=0X00;”你把“PORTC=0X00;”改成了“TRSIC=0XFF;”(TRISC的第二个拼写错误)请别那么神秘,并且准确地解释你想知道的是什么。
以上来自于百度翻译 以下为原文 The point of your question is not very obvious. You have mis-spelt TRISC twice. You changed "PORTB=0XFF;" to "PORTB=0X00;" and you changed "PORTC=0X00;" to "TRSIC=0XFF;" (the second mispelling of TRISC) please be less cryptic, and explain exactly what it is that you want to know. |
|
|
|
|
|
据我所知,“TRSIC”不是PIC寄存器。如果你研究一下你设备的数据表中的I/O端口部分,它将有助于清理问题。
以上来自于百度翻译 以下为原文 "TRSIC" isn't a PIC register as far as I am aware. If you study the I/O Ports section in your device's Data Sheet it'll help clear things up. |
|
|
|
|
|
对不起,这是我只要求TIS的拼写错误,我提到了PORTC和PORTB。
以上来自于百度翻译 以下为原文 sorry that was an spelling mistake i'm asking for TRIS only and i mentioned portc and portb |
|
|
|
|
|
你对TIS寄存器有什么要求?正如我已经说过的,目前还不清楚你在问什么。
以上来自于百度翻译 以下为原文 WHAT are you asking about the TRIS registers? As I already said, it's not clear what it is you are asking about. |
|
|
|
|
|
将PORTX定义为0x00或0xFF的目的是什么?
以上来自于百度翻译 以下为原文 what is the purpose of defining PORTx as 0X00 or 0XFF..? |
|
|
|
|
|
您不是“定义”端口。那些语句将值写入端口。将0x00写入端口将把所有端口引脚设置为低。将0xFF写入端口引脚将设置为高。将值写入TRIS寄存器将设置每个端口引脚的方向。这些都记录在每个PIC的数据表中。
以上来自于百度翻译 以下为原文 You are not "defining" the port. Those statements write that value to the port. Writing 0x00 to the port will set all the port pins low. Writing 0xFF will set them all high. Writing values to the TRIS registers sets the direction of each port pin. This is all documented in the datasheet for each PIC. |
|
|
|
|
|
顺便说一句,我不确定你为什么用“config”这个动词。从某种意义上说,你可以描述写到TRIS寄存器以设置一种“配置”的类型。它通常只在代码开始时执行一次。我不会把写数据到端口寄存器描述为“c”。然而,“成形”。
以上来自于百度翻译 以下为原文 By the way, I am not sure why you are using the verb "config". In a manner of speaking, you could describe writing to the TRIS register to set the directions a type of "configuration". It's commonly only done once at the start of your code. I would not describe writing data to the port registers as "configuration" though. |
|
|
|
|
|
|
|
|
|
|
|
另一个我怀疑只有QHB.什么是使用设置端口高或低?
以上来自于百度翻译 以下为原文 another i doubt only qhb what is use of setting PORT as high or low..? |
|
|
|
|
|
例如,我将使用PORTB作为输入手段,哪些值我必须设置为端口…?
以上来自于百度翻译 以下为原文 for example i am going to use PORTB as input means which value i have to set to PORT..? |
|
|
|
|
|
|
|
|
|
|
|
OK DRIGO我们将设置端口的值?设置端口值的目的是什么?
以上来自于百度翻译 以下为原文 OK DarioG where we will set the values for port..? what is the purpose of setting the port values..? |
|
|
|
|
|
一个也没有。其他人控制PIN,并且检测PIN是高还是低。这就是为什么他们把它称为输入。
以上来自于百度翻译 以下为原文 None. Somebody else controls the pin and you detect whether the pin is high or low. That's why they call it input. |
|
|
|
|
|
TrISB= 0xFFWR将使您所有的PULTB引脚输入,您可以通过读取寄存器PORTB读取
以上来自于百度翻译 以下为原文 TRISB=0xff will make all of your PortB pins inputs, that you can read by reading register PORTB |
|
|
|
|
|
绝对没有,如果引脚都是输入。这是你的第一个微控制器项目吗?你似乎对绝对的基本知识有很有限的了解。
以上来自于百度翻译 以下为原文 Absolutely none if the pins are all inputs. Is this your first ever microcontroller project? You seem to have a very limted understanding of the absolute basics. |
|
|
|
|
|
QHB,我对微控制器很陌生,我无法从数据表中得到清晰的想法……我想知道端口。
以上来自于百度翻译 以下为原文 qhb,i"m new to microcontrollers,I can't get clear idea from datasheets... I want to know about ports. |
|
|
|
|
|
我想把继电器与微控制器……在切换方法中,哪一种是最好的使用PNP或NPN?
以上来自于百度翻译 以下为原文 i would like to interface relay with microcontroller... In switching method which one is best eitheir using PNP OR NPN..? |
|
|
|
|
|
要确定你想知道端口是什么并不容易。如果继电器从与PIC相同的电源运行(例如,如果两者都从5V运行),则没关系。你可以在继电器和+5V轨道之间放置一个PNP晶体管,并将其基极拉低以接通继电器,你可以在继电器线圈和地之间加一个NPN晶体管,然后把其基极拉高,使继电器接通。如果你想从比PIC高的电压驱动继电器线圈(例如5V的PIC,12V的继电器),那么在线圈接地侧使用NPN晶体管是最容易的。
以上来自于百度翻译 以下为原文 It is not easy to determine WHAT it is you want to know about ports. If the relay is running from the same power supply as your PIC (e.g. if both are running from 5V), then it doesn't matter. You can put a PNP transistor between the relay and the +5V rail, and pull its base low to turn the relay on, or you can put an NPN transistor between the relay coil and ground, and pull its base high to turn the relay on. If you want to drive the relay coil from a HIGHER voltage than the PIC (e.g. PIC from 5V, and relay from 12V), then it is easiest to use an NPN transistor on the ground side of the coil. |
|
|
|
|
|
TRIS寄存器设置端口方向(输入或输出)。PORT寄存器用于从端口读取数据(您应该使用LAT寄存器将数据写入端口)。在设备数据表中可能会发现您自己有这样的(以及更多)信息。
以上来自于百度翻译 以下为原文 TRIS registers sets the port direction (either input or output). PORT registers are used for reading data from the port (you should use LAT registers for writing data to the port). You may find yourself such (and more) info in the device datasheet. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475 浏览 0 评论
5794 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1125浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1098浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 14:10 , Processed in 1.073976 second(s), Total 112, Slave 94 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
3415