完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,Microchip管理员,我不能在PIC18F97 J94上使用It1、It2、It3。你能告诉我,我如何配置在It1和It2或Rp28和Rp29 iT3上重新映射RP26和RP2?多谢!
以上来自于百度翻译 以下为原文 Hello microchip admin, I cannot not use INT1,INT2,INT3 on PIC18F97J94. Could you show me, how can I configure the remapping RP26 and RP2 on INT1 and INT2 or RP28 and RP29 INT3? many thanks! |
|
相关推荐
5个回答
|
|
在PIC18F97 J94上,It1、It2和It3在PPS Lite引脚上,这意味着每个只能被分配给某些引脚。INT1不能分配给RP2或RP26,只有以下引脚:RP1-0x0RP5-0x1RP9-0x2RP13-0x3RP17-0x3RP17-0x4RP21-0x5RP25-0x6RP29-0x7RP33-0x8RP37-0x9RP41-0xARP45-0xBThis在数据表的第227页的表11-13中列出。为了给这些引脚之一分配INT1,RPINR26_27寄存器的位<3:0>必须写到该表上概述的值以及上面列表中概述的值。类似地,It2和It3必须设置在表228中各自表中列出的RP引脚中的一个。例如,下面的代码将将It1设置为RB1(RP9)、It2到RB2(RP14)和It3到RB3(RP7)。
以上来自于百度翻译 以下为原文 On the PIC18F97J94, INT1, INT2, and INT3 are on PPS-Lite pins, meaning that each can only be assigned to certain pins. INT1 cannot be assigned to RP2 or RP26, only the following pins:
INT2 and INT3 similarly must be set to one of the RP pins listed in their respective tables on page 228. For example, the following code will set INT1 to RB1 (RP9), INT2 to RB2 (RP14) and INT3 to RB3 (RP7) [INT1-3 PPS] // Configure RB1/INT1, RB2/INT2, RB3/INT3 RPINR26_27=32 // INT1/RB1 & INT2/RB2 RPINR28_29=F1 // INT3/RB3 [INT1-3 I IE] // enable interrupts on RB1/INT1, RB2/INT2, RB3/INT3 CALL (INT1-3 PPS) // configure PPS TRISB|04 // configure RB2 as input INTCON3|38 // enable interrupts INTCON3&F8 // clear interrupts |
|
|
|
……并且确保使用的PIN不是模拟模式。
以上来自于百度翻译 以下为原文 ...and make sure the pin you use is not in analog mode. |
|
|
|
嗨,NJT,首先感谢你的快速回答,这对我很有帮助。但当我在第227.1页的表11-13看时,有很多事情我无法理解。我怎么知道哪个引脚被分配用于中断It1/It2/It3?当我阅读第227页上的数据表(PIC18F97J94)时,我认为INT1/INT2仅与RP26和RP27相关联,而INT3与RP28和RP29相关联。没有信息表明INT1被分配有RP1、RP5、RP9、RP13、RP17、RP21、RP25、RP29、RP33、RP37、RP41和RP45.2。我怎么知道应该给寄存器PRINNR_26_27分配哪个值呢?您的示例:PRINNR26_27=32,PRINNR_28_29=F13。我设置使用具有INT1INTCON3位的RB1。INT1IE=0;//禁用INT1PPSUnLock();//unlockRPINR26_27=32;//32?PPSLock();//lockTRISBbits.TRISB0=1;//RB1作为InputINTCON3bits.INT1IE=1;//Enable INT1INTCON3bits.INT1IF=0;//clearinter.s我的策略有问题吗,请帮助我。
以上来自于百度翻译 以下为原文 Hi NJT, first of all many thanks for your quick answer, it was helpful for me. But there is lots things I could not understand when I looked on table 11-13 on page 227. 1. How could I know which pins are assigned for interrupt INT1/INT2/INT3 ?. When I read the datasheet(PIC18F97J94) on page 227 I thought INT1/INT2 is only associate with RP26 and RP27 and INT3 with RP28 and RP29. There is no information shows that INT1 is assigned with RP1,RP5,RP9,RP13,RP17,RP21,RP25,RP29,RP33,RP37,RP41 and RP45. 2.How could I know which value should be allocate to the register PRINNR_26_27? your example: PRINNR26_27=32 and PRINNR_28_29=F1 3.My setting for using RB1 with INT1 INTCON3bits.INT1IE=0; //Disable INT1 PPSUnLock(); //unlock RPINR26_27=32 ; //32?? PPSLock(); //lock TRISBbits.TRISB0=1; //RB1 as Input INTCON3bits.INT1IE=1; //Enable INT1 INTCON3bits.INT1IF=0; // clear interrupts Is there sth. wrong in my strategy, pls help me. |
|
|
|
它们将位于您通过写入适当的PPS寄存器所选择的引脚上。您完全误读了那个表。INT1的线路告诉您,它是由名为“RPINR26_27”的寄存器的位3到0(“<3:0>”)控制的,即4位,因此它可以容纳16个值中的一个。然后,向下看该表的下半部分,它列出了由这16个可能值中的每一个选择的引脚。0选择RP11,选择RP52,选择RP9,以此类推。当您正确阅读该表时,就会出现这种情况。这意味着位<7:4>包含3:0>包含2b。其RPINR26_27的<7:4>选择INT2的管脚(这在页面229中显示)“3”选择RP14,因此INT2连接到RP14位<3:0>RPINR26_27选择INT1“2”选择RP9的管脚,因此INT1连接到RP9Oop,我读“32”作为十六进制值。它是十进制的,所以您需要转换为十六进制first.32=0x20,这意味着比特<7:4>包含2,比特<3:0>包含0比特<7:4>RPINR26_27选择INT2的管脚(这显示在第229页)“2”选择RP10,所以INT2连接到RP10比特<3:0>;RPINR26_27选择tIn 1“0”的PIN选择RP1,所以It1连接到RP1。
以上来自于百度翻译 以下为原文 They will be on the pins that YOU have selected by writing to the appropriate PPS registers. You are totally misreading that table. The line for INT1, tells you that it is controlled by bits 3 to 0 ("<3:0>") of the register named "RPINR26_27" That is four bits, so it can hold one of sixteen values. You then look down into the lower half of that table, and it lists what pin is selected by each of those sixteen possible values. zero selects RP1 1 selects RP5 2 selects RP9, and so on. There is when you read the table correctly. Oops, I read "32" as a hex value. It's decimal, so you need to convert to hex first. 32 = 0x20, which means bits <7:4> contain 2, and bits <3:0> contain 0 bits <7:4> of RPINR26_27 selects the pin for INT2 (this is shown on page 229) "2" selects RP10, so INT2 is connected to RP10 bits <3:0> of RPINR26_27 selects the pin for INT1 "0" selects RP1, so INT1 is connected to RP1 |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5162 浏览 9 评论
2000 浏览 8 评论
1928 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3172 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2226 浏览 5 评论
731浏览 1评论
613浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
503浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
629浏览 0评论
527浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 08:10 , Processed in 1.745330 second(s), Total 86, Slave 70 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号