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

Sleep/Idle board drawing 22mA (!), Anything I missed ?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 12:50 am     Reply with quote

Ok,

I confirmed that: Its a good fet, good regulator, both are properly hooked up, correct parts are being used, and at least I know the regulator is only drawing .5mA

For fun I pulled the source pin on my fet. I find out that there is still voltage (4V) on the drain pin. Ok. I checked the clock for the 2515, I find that its ON. The whole board is being powered albeit by a little less voltage then the regulator is putting out.

I've lowered every pin on the pic except for the SPI pins. But it doesn't make sense that I have a pin going from the pic to an unpowered IC and its feeding back into VDD of that chip. It has to be a problem with the board...

I'm sure its not a CCS fuse, but is there a way to shut the SPI peripheral down just so I can check? Or any other likely culprits ?

I'll get the scope and dmm to it in the AM
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 12:51 am     Reply with quote

When ur gate is floating, it can be triggered by blowing on it. Add a resistor as asmallri said.
asmallri



Joined: 12 Aug 2004
Posts: 1680
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Jun 20, 2006 12:57 am     Reply with quote

iso9001 wrote:
I've lowered every pin on the pic except for the SPI pins. But it doesn't make sense that I have a pin going from the pic to an unpowered IC and its feeding back into VDD of that chip. It has to be a problem with the board...


Yes it does. It means current is flowing throught the input protection diode to the VDD line. There is also a good chance you are destroying the chip. Pretty hard to help much without seeing the schematic.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 1:04 am     Reply with quote

Quote:
I've lowered every pin on the pic except for the SPI pins

Why not just disable the SPI port and set those pins to a low level ?
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 2:05 am     Reply with quote

Quote:
When ur gate is floating, it can be triggered by blowing on it. Add a resistor as asmallri said.


Its not floating I have a sleeping pic holding 5V to it. I've already learned first hand how sensitive Fets are. That reminds me, I asked about this pull down once before and someone here told me didn't need it cause it was a P-Ch.... I thought that was wrong!

I just realized that aside from not disabling SPI, I am driving all pins low except for the CS pins they go high. Would they they have designed SPI parts to direct all voltage on CS pins to VDD when VDD=0 ?... I mean, other people use fets to load switch. It seems like that would be a rather large issue.

I will disable SPI and try it again. Was just wondering if its common practice to setup_SPI() once at boot then after waking from sleep just go on about working again, or disable spi before sleep.
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 6:54 am     Reply with quote

do you use the SCI?
Try disabling it by

Code:
setup_uart ( FALSE ) ;
newguy



Joined: 24 Jun 2004
Posts: 1946

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 10:06 am     Reply with quote

iso9001 wrote:
I've lowered every pin on the pic except for the SPI pins. But it doesn't make sense that I have a pin going from the pic to an unpowered IC and its feeding back into VDD of that chip. It has to be a problem with the board...


I do all my s/w prototyping using a couple of development boards. They have built-in standard character LCD modules. The LCDs are powered via a jumper to Vdd. The connections between the PIC and the LCD's data and control lines can't be broken.

If I remove the jumper, the LCD will still be weakly powered (i.e. you can still see things on it) as long as at least one of the data or control lines is driven high by the PIC. This has never damaged the LCD, by the way.
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 12:43 pm     Reply with quote

Newguy in for the win!

It was the SPI Data Out and Clock pins. Whats wierd is that I've never heard of this. And judging by everyone's responses here SPI wasn't the first suspect.

Now..... Is there anyway to disable the SPI in CCS ? Or at least stop the DO and CK pins from going high / Force them low....

I appreciate the help everyone! I've learned a lot about power managment.

For the time being I put the device into SPI_SS_DISABLED (have no idea what this does yet, need to check datsheet) and tris'd the C3/C4/C5 pins low.

I need to look into that and the fact my clock is taking 9mA. I can't disable b/c I need to wake-on-can which all the datasheet say I can do w/o a clock but no... doesn't seem to work.

W/O the clock I'm pulling 700uA for the board. If I can figure out the two problems I'm still having I'll be super stoked!
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 3:08 pm     Reply with quote

Quote:
Now..... Is there anyway to disable the SPI in CCS ?
Not explicitely mentioned in the manual, but using the project wizard you learn
Code:
setup_spi(FALSE);
Note from the datasheet
Quote:
When enabled, these pins must be properly configured as input or output.


Quote:
Or at least stop the DO and CK pins from going high / Force them low....
The clock line can be set using the Clock Polarity Select bit (CKP)
Code:
setup_spi(SPI_MASTER | SPI_L_TO_H)  // Idle state for clock is a low level
setup_spi(SPI_MASTER | SPI_H_TO_L)  // Idle state for clock is a high level


Quote:
For the time being I put the device into SPI_SS_DISABLED (have no idea what this does yet, need to check datsheet)
Never set values that you don't understand.... This particular setting is only to be used in SPI-slaves and enables the Slave Select Pin (SS). Using this defined value in a master is a common mistake and makes a mess of the SPI setup (you get an invalid OR-ed value, SPI doesn't work as expected and sadly the compiler gives no error message).
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Tue Jun 20, 2006 3:37 pm     Reply with quote

I knew that SS wasn't right but I was setting it into slave mode so it 'kinda' worked.

I'll try that setup_spi(FALSE); Then pull the pins low. Thanks Ckielstra


By the way, does ~9mA sound about right for a 10Mhz ceramic osc w/ built in caps?
asmallri



Joined: 12 Aug 2004
Posts: 1680
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Jun 21, 2006 5:21 am     Reply with quote

Yes
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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