完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我正在玩PIC16F18345和睡眠模式,但是电流似乎太高了。PIC由2.8V供电,没有PIN连接(所有都是浮动的),PIC在1MHz下运行。根据数据表,消费应该在1μA的区域,甚至更少,但是我测量了13μA。我在论坛上看到PIC Cou.LD被ESD损坏。我换了它,但是新的几乎消耗了12(A),我不知道出了什么问题。我的代码中有什么遗漏了吗?这是我的测试代码:
以上来自于百度翻译 以下为原文 Hi, I am playing with PIC16F18345 and sleep mode but current seems too high to me. PIC is powered by 2.8V, no pin is connected (all are floating), PIC runs at 1MHz. According to datasheet the consumption should be in the area of 1µA and even less, but I measured 13µA. I read in the forum that PIC could be damaged by ESD. I changed it, but the new one consumes almost the same (12µA). I do not know what is wrong. Do I have something missing in my code? This is my test code: #define _XTAL_FREQ 1000000 // CONFIG1 #pragma config FEXTOSC = OFF // FEXTOSC External Oscillator mode Selection bits (Oscillator not enabled) #pragma config RSTOSC = HFINT1 // 1MHz #pragma config CLKOUTEN = OFF // Clock Out Enable bit (CLKOUT function is disabled; I/O or oscillator function on OSC2) #pragma config CSWEN = OFF // Clock Switch Enable bit (Writing to NOSC and NDIV is allowed) #pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is enabled) // CONFIG2 #pragma config MCLRE = OFF // Master Clear Enable bit (MCLR/VPP pin function is MCLR; Weak pull-up enabled) #pragma config PWRTE = OFF // Power-up Timer Enable bit (PWRT disabled) #pragma config WDTE = OFF // Watchdog Timer Enable bits (WDT disabled; SWDTEN is ignored) #pragma config LPBOREN = OFF // Low-power BOR enable bit (ULPBOR disabled) #pragma config BOREN = OFF // Brown-out Reset Enable bits (Brown-out Reset enabled, SBOREN bit ignored) #pragma config BORV = LOW // Brown-out Reset Voltage selection bit (Brown-out voltage (Vbor) set to 2.45V) #pragma config PPS1WAY = ON // PPSLOCK bit One-Way Set Enable bit (The PPSLOCK bit can be cleared and set only once; PPS registers remain locked after one clear/set cycle) #pragma config STVREN = OFF // Stack Overflow/Underflow Reset Enable bit (Stack Overflow or Underflow will cause a Reset) #pragma config DEBUG = OFF // Debugger enable bit (Background debugger disabled) // CONFIG3 #pragma config WRT = OFF // User NVM self-write protection bits (Write protection off) #pragma config LVP = OFF // Low Voltage Programming Enable bit (Low Voltage programming enabled. MCLR/VPP pin function is MCLR. MCLRE configuration bit is ignored.) // CONFIG4 #pragma config CP = OFF // User NVM Program Memory Code Protection bit (User NVM code protection disabled) #pragma config CPD = OFF // Data NVM Memory Code Protection bit (Data NVM code protection disabled) // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. #include #include void setup(void) { // set ports to output TRISA=0; TRISB=0; TRISC=0; // disable analog ANSELA=0; ANSELB=0; ANSELC=0; // disable peripherals PMD0=0xff; PMD1=0xff; PMD2=0xff; PMD3=0xff; PMD4=0xff; PMD5=0xff; } void main(void) { setup(); SLEEP(); } |
|
相关推荐
1个回答
|
|
我绝望了,花了我一天的时间来尝试一切,但幸运的是,现在我想出了微笑:我改变了电压调节器控制寄存器为:VRIGPM=0B11;现在PIC消耗0.4μA。
以上来自于百度翻译 以下为原文 I was desperate, it took me a day to try everything, but luckily now I figured it out Smile: I changed voltage regulator control register to: VREGPM=0b11; And now PIC consumes 0.4µA. |
|
|
|
只有小组成员才能发言,加入小组>>
5141 浏览 9 评论
1989 浏览 8 评论
1917 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3159 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2215 浏览 5 评论
708浏览 1评论
598浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
481浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
609浏览 0评论
508浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-9 09:35 , Processed in 1.076376 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号