View previous topic :: View next topic |
Author |
Message |
peterl
Joined: 09 Oct 2009 Posts: 13 Location: SF,BG
|
12f675 high consumption 7.5ma |
Posted: Sat Apr 10, 2010 10:22 am |
|
|
Hi,
I have a problem with this microcontroller 12f675. I think there is an unusually high consumption - 7.5ma. In datasheet is wrote 1.4ma at 5V and 4MHZ. This is my program:
Code: |
#include <12F675.h>
#device adc=8
#FUSES NOWDT
#FUSES XT
#FUSES NOCPD
#FUSES NOPROTECT
#FUSES NOMCLR
#FUSES NOPUT
#FUSES NOBROWNOUT
#FUSES BANDGAP_HIGH
#use delay(clock=4000000)
//#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
#include "D:\Dimer_V.2\main.h"
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_comparator(NC_NC);
setup_vref(FALSE);
for(;;)
{
output_high(PIN_A2);
Delay_ms(1000);
output_low(PIN_A2);
Delay_ms(1000);
}
}
|
On PIN_A2 nothing connected. I measured direct on Pin 1. Could be a faulty microcontroller?
Thanks |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Sat Apr 10, 2010 12:57 pm |
|
|
Probably quite expected....
It sounds as if you have your unused pins _floating_. Depending on the noise etc., a floating pin can easily result in a large fraction of a mA being drawn, if it happens to float into the transition region. If all the pins are floating, 7.5mA is quite possible.
You need to define the other pins as output, or apply logic levels to them (pull ups are easy....).
Other thing, are you measuring with a voltage regulator being used?. If so, this can easily draw several mA.
Best Wishes |
|
|
peterl
Joined: 09 Oct 2009 Posts: 13 Location: SF,BG
|
12f675-consumption |
Posted: Sun Apr 11, 2010 3:35 am |
|
|
I rewrote the program
Code: |
#include <12F675.h>
#device adc=8
#FUSES NOWDT
#FUSES INTRC_IO
#FUSES NOCPD
#FUSES NOPROTECT
#FUSES NOMCLR
#FUSES NOPUT
#FUSES NOBROWNOUT
#FUSES BANDGAP_HIGH
#use delay(clock=4000000)
//#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
#include "D:\Dimer_V.2\main.h"
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_comparator(NC_NC);
setup_vref(FALSE);
for(;;)
{
output_low(PIN_A0);
output_low(PIN_A1);
output_low(PIN_A2);
output_low(PIN_A3);
output_low(PIN_A4);
output_low(PIN_A5);
}
} |
but nothing happened. By the way what to use this #FUSES BANDGAP_HIGH
best regards |
|
|
hmmpic
Joined: 09 Mar 2010 Posts: 314 Location: Denmark
|
|
Posted: Sun Apr 11, 2010 6:00 am |
|
|
@Ttelmah
You talk about unused floating pin's.
Will you say the programmer must take care on all unused pin on the pic?
I normally just leave them as is, is that wrong? |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Sun Apr 11, 2010 8:04 am |
|
|
All digital pins should be at a solid logic 1 or solid logic 0, either by external hardware or driven by the PIC. If a digital pin is allowed to float to an intermediate voltage it can cause the pin transistors to draw a lot of current. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
peterl
Joined: 09 Oct 2009 Posts: 13 Location: SF,BG
|
|
Posted: Wed Apr 14, 2010 12:05 pm |
|
|
I changed my PIC with 12F629 and now consumption is lower than 0.6ma
Thanks everybody again!
p.s.I reduced the voltage from 5V to 3.3V,which also had a significant impact |
|
|
|