CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

12f675 high consumption 7.5ma

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
peterl



Joined: 09 Oct 2009
Posts: 13
Location: SF,BG

View user's profile Send private message

12f675 high consumption 7.5ma
PostPosted: Sat Apr 10, 2010 10:22 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Apr 10, 2010 12:57 pm     Reply with quote

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

View user's profile Send private message

12f675-consumption
PostPosted: Sun Apr 11, 2010 3:35 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Apr 11, 2010 6:00 am     Reply with quote

@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

View user's profile Send private message

PostPosted: Sun Apr 11, 2010 8:04 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Apr 14, 2010 12:05 pm     Reply with quote

I changed my PIC with 12F629 and now consumption is lower than 0.6ma Smile
Thanks everybody again!

p.s.I reduced the voltage from 5V to 3.3V,which also had a significant impact Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group