• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
:::


Browsing this Thread:   1 Anonymous Users






Re: 請問省電模式要如何設定與控制??
#5
初級會員
初級會員


查看用戶資訊
也謝謝你的程式!
不過我是用組語寫的,我還沒有學過ccs的東西,所以不好意思我不太懂函數的用法。
不知可不可以建議又去看哪一本入門書有介紹用c來寫單晶片,又容易上手的(超想學的)。

發表於: 2005/8/24 18:54
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問省電模式要如何設定與控制??
#4
初級會員
初級會員


查看用戶資訊
最近幾天看了很多資料,我終於弄懂了。
也謝謝版主的建議!

發表於: 2005/8/24 18:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問省電模式要如何設定與控制??
#3
高級會員
高級會員


查看用戶資訊
我喜歡做好人所以住你一把
我是用CCS 寫的
耗電大概是32UA
//#include <12C508A.h>
#include <12f675.h>

#fuses LP,WDT,NOPROTECT, NOMCLR,NOBROWNOUT
//#byte gpio = 06
//#bit P_SYNC = gpio.0
//#bit P_OUT = gpio.1
//#BIT P_DEBUG = gpio.2
//#BIT P_HZ = gpio.4
#byte gpio = 05
#bit P_OUT = gpio.0
struct {
short bit0;
short bit1;
short bit2;
short bit3;
short bit4;
short bit5;
short bit6;
}flg0;
//#define GP0 PIN_A0
//#define GP1 PIN_A1
//#define GP2 PIN_A2
//#define GP3 PIN_A3
//#define GP4 PIN_A4
//#define GP5 PIN_A5
//#define P_OUT GP0

#define f_tmain flg0.bit0
#define F_HZ flg0.bit1
#DEFINE F_TIMEOUT flg0.bit2

INT8 TB_1SEC,TB_SEC,TB_MIN,TB_HOUR,T_OUT;
//int16 COUNTER;

#use delay(clock=32768) // 4000000) // SET DELAY CLOCK 4MHZ

void POWERON_INIT()
{
set_tris_a(0x00);
output_a(0x01);
setup_counters (RTCC_INTERNAL,WDT_2304MS);
// set_tris_b(0xfe);
setup_wdt(WDT_2304MS);

}
void main()
{
POWERON_INIT();
// SLEEP();
while(1)
{
int8 i;
for (i=0;i<250;i++)
{
// output_low(P_OUT); // OUTPUT PWM
P_OUT = 0;
delay_us(500);
P_OUT=1;
// output_high(P_OUT);
delay_us(500);
}
// output_high(P_OUT);
P_OUT = 1;
restart_wdt();
sleep();
}
}
當LED ON時我是用掃瞄方式還可以省很多電流消耗量
我裝一顆鈕釦電池放在我的愛車面版上假裝防盜系統至今已經過了好久還在WORK
算是蠻省電了
希望你會喜歡



發表於: 2005/8/24 10:47
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 請問省電模式要如何設定與控制??
#2
版主
版主


查看用戶資訊
進入 Sleep Mode 只要執行 "SLEEP" 這個指令集可進入睡眠模式。

1. 如果要準確的8秒喚醒一次,可以用 32768Hz 的石英晶體接到 Timer1 ,Prescaler 設為 1:8, Timer 設為 32768, 模式要設為非同步模式,這樣就可以每八秒叫醒 PIC 一次。

2. 如果時間大概就可以了,就可以考慮用 Watch-Dog Timer 來喚醒 CPU, 如果WDT時間約為2 秒,那就設個 count = 4 實在執行 8 秒的動作。

3. 未達更省電,考慮將一些會耗電的周邊關掉,例如: LVD, BOD, Voltage Reference, Comparator ... etc.

發表於: 2005/8/23 16:22
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


請問省電模式要如何設定與控制??
#1
初級會員
初級會員


查看用戶資訊
各位好:
初學者請教一些問是就是我每八秒偵測一次sensor,如果sensor沒有輸出就進入省電模式,八秒後再醒來偵測一次,依序循環。但是我有看過書了,還是搞不懂sleep要如何使用,
那如果進入sleep後要如何喚醒(有哪些方式呢)??
謝謝!

發表於: 2005/8/22 17:57
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------