完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我使用PIC18F45 K22 XC8我的PIN RC1不工作。这是我的代码“在我的主要我使用AIR”=低或高,似乎不起作用。
以上来自于百度翻译 以下为原文 I'm using Pic18F45K22 XC8 My pin Rc1 doesnt work. Here is my code" #define TRIAC_AIR_TRIS TRISCbits.RC1 #define AIR_IO LATCbits.LATC1 TRIAC_AIR_TRIS=OUTPUT; #pragma config FOSC = XT // Oscillator Selection bits->XT oscillator #pragma config PLLCFG = ON // 4X PLL Enable->Oscillator multiplied by 4 #pragma config PRICLKEN = ON // Primary clock enable bit->Primary clock is always enabled #pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable bit->Fail-Safe Clock Monitor disabled #pragma config IESO = OFF // Internal/External Oscillator Switchover bit->Oscillator Switchover mode disabled // CONFIG2L #pragma config PWRTEN = OFF // Power-up Timer Enable bit->Power up timer disabled #pragma config BOREN = SBORDIS // Brown-out Reset Enable bits->Brown-out Reset enabled in hardware only (SBOREN is disabled) #pragma config BORV = 190 // Brown Out Reset Voltage bits->VBOR set to 1.90 V nominal // CONFIG2H #pragma config WDTEN = OFF // Watchdog Timer Enable bits->Watch dog timer is always disabled. SWDTEN has no effect. #pragma config WDTPS = 32768 // Watchdog Timer Postscale Select bits->1:32768 // CONFIG3H #pragma config CCP2MX = PORTC1 // CCP2 MUX bit->CCP2 input/output is multiplexed with RC1 #pragma config PBADEN = OFF // PORTB A/D Enable bit->PORTB<5:0> pins are configured as analog input channels on Reset #pragma config CCP3MX = PORTB5 // P3A/CCP3 Mux bit->P3A/CCP3 input/output is multiplexed with RB5 #pragma config HFOFST = ON // HFINTOSC Fast Start-up->HFINTOSC output and ready status are not delayed by the oscillator stable status #pragma config T3CMX = PORTC0 // Timer3 Clock input mux bit->T3CKI is on RC0 #pragma config P2BMX = PORTD2 // ECCP2 B output mux bit->P2B is on RD2 #pragma config MCLRE = EXTMCLR // MCLR Pin Enable bit->MCLR pin enabled, RE3 input pin disabled // CONFIG4L #pragma config STVREN = ON // Stack Full/Underflow Reset Enable bit->Stack full/underflow will cause Reset #pragma config LVP = OFF // Single-Supply ICSP Enable bit->Single-Supply ICSP disabled #pragma config XINST = OFF // Extended Instruction Set Enable bit->Instruction set extension and Indexed Addressing mode disabled (Legacy mode) #pragma config DEBUG = OFF // Background Debug->Disabled // CONFIG5L #pragma config CP0 = OFF // Code Protection Block 0->Block 0 (000800-001FFFh) not code-protected #pragma config CP1 = OFF // Code Protection Block 1->Block 1 (002000-003FFFh) not code-protected #pragma config CP2 = OFF // Code Protection Block 2->Block 2 (004000-005FFFh) not code-protected #pragma config CP3 = OFF // Code Protection Block 3->Block 3 (006000-007FFFh) not code-protected // CONFIG5H #pragma config CPB = OFF // Boot Block Code Protection bit->Boot block (000000-0007FFh) not code-protected #pragma config CPD = OFF // Data EEPROM Code Protection bit->Data EEPROM not code-protected // CONFIG6L #pragma config WRT0 = OFF // Write Protection Block 0->Block 0 (000800-001FFFh) not write-protected #pragma config WRT1 = OFF // Write Protection Block 1->Block 1 (002000-003FFFh) not write-protected #pragma config WRT2 = OFF // Write Protection Block 2->Block 2 (004000-005FFFh) not write-protected #pragma config WRT3 = OFF // Write Protection Block 3->Block 3 (006000-007FFFh) not write-protected // CONFIG6H #pragma config WRTC = OFF // Configuration Register Write Protection bit->Configuration registers (300000-3000FFh) not write-protected #pragma config WRTB = OFF // Boot Block Write Protection bit->Boot Block (000000-0007FFh) not write-protected #pragma config WRTD = OFF // Data EEPROM Write Protection bit->Data EEPROM not write-protected // CONFIG7L #pragma config EBTR0 = OFF // Table Read Protection Block 0->Block 0 (000800-001FFFh) not protected from table reads executed in other blocks #pragma config EBTR1 = OFF // Table Read Protection Block 1->Block 1 (002000-003FFFh) not protected from table reads executed in other blocks #pragma config EBTR2 = OFF // Table Read Protection Block 2->Block 2 (004000-005FFFh) not protected from table reads executed in other blocks #pragma config EBTR3 = OFF // Table Read Protection Block 3->Block 3 (006000-007FFFh) not protected from table reads executed in other blocks // CONFIG7H #pragma config EBTRB = OFF Inside my main i'm using AIR_IO=LOW or HIGH and doesnt seem to work. |
|
相关推荐
9个回答
|
|
如果你揭示“似乎不起作用”实际上意味着什么,那么帮助你就容易多了。你做了什么,你期望看到什么,你到底看到了什么?
以上来自于百度翻译 以下为原文 It's a lot easier to help if you reveal what "doesn't seem to work" actually means. What did you do, what did you expect to see, and what did you actually see? |
|
|
|
|
|
|
|
这只是你的代码的一小部分。如果有任何原因使二次振荡器被启用,RC1变成SCOSCI。它可以由SCOSGO、T1OSCEN、T3OSCEN、T5OSCEN启用。您是否意外设置了那些未显示的代码中的任何位?
以上来自于百度翻译 以下为原文 That's only a small part of your code. If anything causes the secondary oscillator to be enabled, RC1 becomes SOSCI. It can be enabled by SOSCGO, T1OSCEN, T3OSCEN, T5OSCEN. Could you be accidentally setting any of those bits in the code you have not shown? |
|
|
|
这是在一系列其他部件的末尾。正如我一直说的,你必须减少未知数。用一个范围或逻辑探头观察销钉本身。它是高、低、浮动、脉冲吗?代码中可能有一个bug,它没有销毁。
以上来自于百度翻译 以下为原文 That is at the end of a chain of other components. As I keep saying, you have to reduce the number of unknowns. Observe the pin itself with a scope or logic probe. Is it high, low, floating, pulsing? There could be a bug in the code twiddling the pin, which you did not post. |
|
|
|
我认为包含MCC图书馆的EECP会导致这个问题。
以上来自于百度翻译 以下为原文 I think containing eecp from mcc libraries causes the problem |
|
|
|
你能张贴你的完整代码(main .c)并显示你的马达是如何连接的吗?
以上来自于百度翻译 以下为原文 Can you post your full code (main.c) and show how your motor is connected? |
|
|
|
是否有任何配置位阻止ECCP2启动我的空气马达?我的气动马达每10分钟移动1英寸,我无法解释为什么会发生这种情况。我不知道如何开始。首先我用的是ECP2的权利是什么?我怎样才能找到计算结果呢?或者在我的ECCP2或PrimaM中我必须做什么配置?
以上来自于百度翻译 以下为原文 Is there any config bits which stops eccp2 from starting my air motor? My air motor is moving for 1'' every 10''. I cant explain why this is happened. I dont know how to start. First my sinvalues which i use for eccp2 are rights? how can i find how to calculate sinvalues? Or is there any configuration which i must do in my eccp2 or pragma? |
|
|
|
|
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5237 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3201 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
772浏览 1评论
662浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
590浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
672浏览 0评论
572浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-21 14:04 , Processed in 2.181724 second(s), Total 92, Slave 76 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号