Power-Down-Modes ECIO28

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
pedsim
Posts: 4
Joined: Wed Jul 04, 2012 10:01 am
Has thanked: 1 time
Contact:

Power-Down-Modes ECIO28

Post by pedsim »

Hello,

i have problems with the power down modes. In my application (I use the ecio28) I need the sleep or sec_idle for app. 2 s then a wake-up from sleep and a check if inputs on PORTB (0-2) are low. The active time should be 300-500ms where the inputs will be checked (in this time PORTB.3 must be a output an high). If there are no inputs (all high) the pic should return in sleep mode (when is any of the Inputs is low the pic should go in the run-mode 48MHz). Is possible the use of a internal 32kHz signal on Tmr1 and to go sec-idle-mode? Or I need then an external oscillator for tmr1? Or it’s better activate wdt and go to sleep? I had problems to change the modes between run and sec_idle or sleep. Can you help me please?

Thanks in advance
pedsim

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Power-Down-Modes ECIO28

Post by Enamul »

Hi,
Is possible the use of a internal 32kHz signal on Tmr1 and to go sec-idle-mode?
I think you can't use internal 32 KHz signal on TMR1 as in sleep mode your main oscillator will not be working.
Or I need then an external oscillator for tmr1?
You can use an external crystal at RC1 & RC0 to run TMR1...
Or it’s better activate wdt and go to sleep?
A better option would be to use watchdog timer..
You can see the following post..
http://www.matrixmultimedia.com/mmforum ... eep#p35638

Thanks,
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Power-Down-Modes ECIO28

Post by Enamul »

Hi Pedsim,

You can also have a look at the following post to get around the use of watchdog timer:
http://www.matrixmultimedia.com/mmforum ... 165#p25165

Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

pedsim
Posts: 4
Joined: Wed Jul 04, 2012 10:01 am
Has thanked: 1 time
Contact:

Re: Power-Down-Modes ECIO28

Post by pedsim »

Hi Enamul,

thanks for your answer.the post that you send about the wdt ist for the 18F452. I use the ECIO28 and Flowcode 5. Can you help me how i must set-up (and switch on) the wdt on this device.

Thanks pedsim

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Power-Down-Modes ECIO28

Post by Enamul »

Hi

I can help you if you have a play with me. I will post some sample program and you will play in hardware and let me know how it works as I don't have any pic hardware with me right now.

Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

pedsim
Posts: 4
Joined: Wed Jul 04, 2012 10:01 am
Has thanked: 1 time
Contact:

Re: Power-Down-Modes ECIO28

Post by pedsim »

Hi Enamul,

thats ok, please post the code and I check if it works and give you answer.

Thanks pedsim

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Power-Down-Modes ECIO28

Post by Enamul »

Hi,

You can have a try with the attached program..I have used TMR1 for 2s count in sleep mode. You have to use 32.768 KHz crystal in RC0 & RC1 besides PIC's main crystal. TMR1 runs in sleep mode if watchdog timer is disabled. After 2s, the 16-bit timer, TMR1 will overflow and generate an interrupt which will wake up PIC from sleep mode.

In TMR1 ISR, I have checked RB0-2 inputs and set RB3 high. If any input from RB0-2 goes low in the monitored 300ms time, PIC will go to run mode..otherwise it will enable TMR1 again and go into sleep mode and wait for another 2s.

Hope this will help. :)
Attachments
ECIO-28.fcf
(17.81 KiB) Downloaded 294 times
Enamul
University of Nottingham
enamul4mm@gmail.com

pedsim
Posts: 4
Joined: Wed Jul 04, 2012 10:01 am
Has thanked: 1 time
Contact:

Re: Power-Down-Modes ECIO28

Post by pedsim »

Hello Enamul,

i have testet the code in Hardware and not all is ok. I have set up TMR1(T1con=0b00001111) and then the code works 1time but the PIC doesn't return in sleep mode and rest in Run-Mode. I look in this an i will post when the code is ok. Many thanks for your help.

Pedsim

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Power-Down-Modes ECIO28

Post by Enamul »

Hi Pedsim,
pedsim wrote: the code works 1time but the PIC doesn't return in sleep mode and rest in Run-Mode.
Can you tell me bit more detail why you are telling so...Have you changed any one of SW from RB0-2 to low state?

In the attached code, I have put always true loop in run mode which means that if you enter in that mode you will be there for ever...you can't return to sleep mode again..
If you need something like when you press any switch between RB0-2..you will enter in "run mode" for executing a particular program after finishing that you will return to sleep mode again..then you have to change that area..

I am attaching here the modified code which will blink RB4 as your run mode program as long as any of RB0-2 keep loow after that it will return to sleep mode..and wait for 2 s and keep on doing repetitive things....

Hope that this is what you are looking for! :)

Enamul
Attachments
ECIO-28.fcf
Modified
(19.29 KiB) Downloaded 274 times
Enamul
University of Nottingham
enamul4mm@gmail.com

Post Reply