caramoan tour package

caramoan tour package

Author Topic: 16x2 LCD clock using PROTON ???  (Read 2952 times)

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1842
  • Pogi/Ganda Points: 53
  • Gender: Male
16x2 LCD clock using PROTON ???
« on: November 17, 2009, 06:08:11 PM »


Pano po pagcode niyan using for loop? kasi nung ginawa ko yun blanko lang lumabas and special characters... kaya ginawa ko diyan paisa2x yung code.. bago lang po sa PROTON kaya medyo makulit po.. tatanong ako ng madami :-P

Code: [Select]
Device 16F877A
XTAL 4


; Display Configuration
LCD_DTPIN = PORTB.4  ' Assigns the Port and Pins that the LCD's DT (data) lines will attach to.  
LCD_RSPIN = PORTB.2  ' Assigns the Port and Pins that the LCD's RS line will attach to.
LCD_ENPIN = PORTB.1  ' Assigns the Port and Pin that the LCD's EN line will attach to.
LCD_INTERFACE = 4    ' Inform the compiler as to whether a 4-line or 8-line interface is required by the LCD.
LCD_LINES = 2        ' Inform the compiler as to how many lines the LCD has.
LCD_TYPE = ALPHA     ' Inform the compiler as to the type of LCD that the PRINT command will output to

Cls
DelayMS 500

start:
        Print At 1,1,"   LOADING..."
        DelayMS 1000
        Cls:DelayMS 10
        Print At 1,1, "00:00:00  --DJC--"  
        Print At 2,1, "  Hello world"      
        DelayMS 1000
        Print At 1,8, "1"
        DelayMS 1000
        Print At 1,8, "2"
        DelayMS 1000
        Print At 1,8, "3"        
        DelayMS 1000
        Print At 1,8, "4"        
        DelayMS 1000
        Print At 1,8, "5"        
        DelayMS 1000
        Print At 1,8, "6"        
        DelayMS 1000
        Print At 1,8, "7"        
        DelayMS 1000
        Print At 1,8, "8"        
        DelayMS 1000
        Print At 1,8, "9"        
        DelayMS 1000
        Print At 1,7, "10"        
        DelayMS 1000
        Print At 1,7, "11"        
        DelayMS 1000
        Print At 1,7, "12"        
        DelayMS 1000        
        Print At 1,7, "13"        
        DelayMS 1000
        Print At 1,7, "14"        
        DelayMS 1000
        Print At 1,7, "15"        
        DelayMS 1000
        Print At 1,7, "16"        
        DelayMS 1000
        Print At 1,7, "17"        
        DelayMS 1000
        Print At 1,7, "18"        
        DelayMS 1000
        Print At 1,7, "19"        
        DelayMS 1000
        Print At 1,7, "20"        
        DelayMS 1000
        Print At 1,7, "21"        
        DelayMS 1000
        Print At 1,7, "22"        
        DelayMS 1000
        Print At 1,7, "23"        
        DelayMS 1000
        Print At 1,7, "24"        
        DelayMS 1000
        Print At 1,7, "25"        
        DelayMS 1000
        Print At 1,7, "26"        
        DelayMS 1000
        Print At 1,7, "27"        
        DelayMS 1000
        Print At 1,7, "28"        
        DelayMS 1000
        Print At 1,7, "29"        
        DelayMS 1000
        Print At 1,7, "30"        
        DelayMS 1000
        Print At 1,7, "31"        
        DelayMS 1000
        Print At 1,7, "32"        
        DelayMS 1000
        Print At 1,7, "33"        
        DelayMS 1000
        Print At 1,7, "34"        
        DelayMS 1000
        Print At 1,7, "35"        
        DelayMS 1000
        Print At 1,7, "36"        
        DelayMS 1000
        Print At 1,7, "37"        
        DelayMS 1000
        Print At 1,7, "38"        
        DelayMS 1000
        Print At 1,7, "39"        
        DelayMS 1000
        Print At 1,7, "40"        
        DelayMS 1000
        Print At 1,7, "41"        
        DelayMS 1000
        Print At 1,7, "42"        
        DelayMS 1000
        Print At 1,7, "43"        
        DelayMS 1000
        Print At 1,7, "44"        
        DelayMS 1000
        Print At 1,7, "45"        
        DelayMS 1000
        Print At 1,7, "46"        
        DelayMS 1000
        Print At 1,7, "47"        
        DelayMS 1000
        Print At 1,7, "48"        
        DelayMS 1000
        Print At 1,7, "49"        
        DelayMS 1000
        Print At 1,7, "50"        
        DelayMS 1000
        Print At 1,7, "51"        
        DelayMS 1000
        Print At 1,7, "52"        
        DelayMS 1000
        Print At 1,7, "53"        
        DelayMS 1000
        Print At 1,7, "54"        
        DelayMS 1000  
        Print At 1,7, "55"        
        DelayMS 1000
        Print At 1,7, "56"        
        DelayMS 1000
        Print At 1,7, "57"        
        DelayMS 1000
        Print At 1,7, "58"        
        DelayMS 1000
        Print At 1,7, "59"        
        DelayMS 1000
        Print At 1,7, "60"        
        DelayMS 1000
        GoTo start


- Pano po pag-increment nung minute kapag nareach na ng seconds yung 60 and pag nareach naman ng mins. yung 60 pano mag-iincrement yung hour.. and pag 12 na yung hour magrereset sa 00:00:00
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

Philippine Electronics Forum

16x2 LCD clock using PROTON ???
« on: November 17, 2009, 06:08:11 PM »

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1842
  • Pogi/Ganda Points: 53
  • Gender: Male
Re: 16x2 LCD clock using PROTON ???
« Reply #1 on: November 17, 2009, 06:58:17 PM »
up!
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

Philippine Electronics Forum

Re: 16x2 LCD clock using PROTON ???
« Reply #1 on: November 17, 2009, 06:58:17 PM »

insomartin

  • Guest
Re: 16x2 LCD clock using PROTON ???
« Reply #2 on: November 17, 2009, 07:01:54 PM »
ANONG CODE YAN!?!?!?! anong kaguluhan ito! ace ah!
hehehe

gawa ka nang variable... like seconds, minutes and hour.
delay 1000
tas compute mo

seconds = seconds + 1

tapos if > 60
minutes = minutes + 1

and so on...

wait antay tayo nang masters dito... tooot.

Philippine Electronics Forum

Re: 16x2 LCD clock using PROTON ???
« Reply #2 on: November 17, 2009, 07:01:54 PM »

Offline tiktak

  • Gas Turbine
  • **
  • Posts: 2864
  • Pogi/Ganda Points: 204
  • Gender: Male
    • Tiktakx's Blog
Re: 16x2 LCD clock using PROTON ???
« Reply #3 on: November 17, 2009, 07:15:07 PM »
IIRC may example ng clock sa samples folder ng proton
8051 stuff

Philippine Electronics Forum

Re: 16x2 LCD clock using PROTON ???
« Reply #3 on: November 17, 2009, 07:15:07 PM »

insomartin

  • Guest
Re: 16x2 LCD clock using PROTON ???
« Reply #4 on: November 17, 2009, 07:16:05 PM »
^ correct.

Philippine Electronics Forum

Re: 16x2 LCD clock using PROTON ???
« Reply #4 on: November 17, 2009, 07:16:05 PM »

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1842
  • Pogi/Ganda Points: 53
  • Gender: Male
Re: 16x2 LCD clock using PROTON ???
« Reply #5 on: November 17, 2009, 07:26:08 PM »
IIRC may example ng clock sa samples folder ng proton

Saan po iyan? di ko alam.. hehe..
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

insomartin

  • Guest
Re: 16x2 LCD clock using PROTON ???
« Reply #6 on: November 17, 2009, 07:34:09 PM »
another thing is that... it won't be precise... it's better na gamit ka nang external clock source like "clock" or the ds1307.

take note that basic language gamit mo. that simply means that after nyan mag compile magiging C, then assembly pa yan... bka may ibang gawin yung compiler na hindi maging precise yung timing mo. it might work for a WEEK na tama time keeping mo but i think after a MONTH or two... i don't know.

but for a quick and dirty clock. that's one solution.

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1842
  • Pogi/Ganda Points: 53
  • Gender: Male
Re: 16x2 LCD clock using PROTON ???
« Reply #7 on: November 17, 2009, 07:44:38 PM »
Ganun po ba? for exact timing pala dapat assembly na lang gamitin ko.. huhuhu.. palipat2x ako ng language.. babalik din pala ako sa assembly.. hay..
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

Offline marcelino

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6027
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: 16x2 LCD clock using PROTON ???
« Reply #8 on: November 17, 2009, 07:53:55 PM »
some PICmicros have RTC with them. PIC16F877A, meron nito... PIC16F628A, meron din... di ko pa to napag-eexperimentuhan.. pero ang challenge kasi sakin ay yung backup power supply. the RTC will consume low power during power down. yung counter/time will still increment, syempre wala nang display... kapagbumalik naman yung power, ibibgay pa din yung tamang time sa display.

mas challenging, pero prone to error.

mas maganda talga ang gumamit ng DS1307.... may terminal na for a battery lalagyan nalang. mura lang na implementation to... (pero di ko pa din makuhakuha yung driver using hitech!!! waaaaahhhh!!!! ;D ;D ;D)

OR

GPS clock!!! heheh :D
sa GPS clock naman, mas maiging umaadar din yung RTC para kung sakaling may lag sa communication with the satellites, sya na muna ang magbibigay ng time. then in incase magkaerror naman sa RTC, kapagnagresume na yung communication with GPS, makocorrect na din yung time. kapag nagkaGPS clock ako, i would make it such that it will only communicate with the satellites with a given time interval.... say every 5 mins. RTC will do the counting most of the time.

Ganun po ba? for exact timing pala dapat assembly na lang gamitin ko.. huhuhu.. palipat2x ako ng language..

not necessarily...

ang ibig sabihin ni don martin ay mag implement ng  external time keeping device. wag ang MCU mismo... note, eventhough hardware module (RTC module) ang gagamitin mo, MCU do run in sequential order. paisa-isa... kung gagamit ka ng hardware interrupt, maaari pang magkaroon ng delay ang pagsilbi sa interrupt na yun... its like giving the time counting job to other device... wag na sa MCU.

so implement external time keeper... ds1307 would be the cheapest. sa tingin ko..... hehehe ;D

ika nga, these devices are created to be time keepers! so let them be... ;D

So stay with your compiler... wag pa bago-bago... ;D kapag kabisado mo na, lipat ka na.

@Don martin, may available ba nito sa e-gizmo?
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

insomartin

  • Guest
Re: 16x2 LCD clock using PROTON ???
« Reply #9 on: November 17, 2009, 08:13:13 PM »
yup andami pang available sa e-gizmo. ginagamit kong temp logger sa... flowershop. (ngayon alam ni sir born2 kung anong ginagawa ko.) yung battery at clip galing sa mga lumang motherboards. kaya ok na ok.

insomartin

  • Guest
Re: 16x2 LCD clock using PROTON ???
« Reply #10 on: November 17, 2009, 08:14:02 PM »
RTC SA 877'a ???

insomartin

  • Guest
Re: 16x2 LCD clock using PROTON ???
« Reply #11 on: November 17, 2009, 08:20:51 PM »
Quote
A crystal oscillator circuit is built-in between pins T1OSI
(input) and T1OSO (amplifier output). It is enabled by
setting control bit T1OSCEN (T1CON<3>). The oscilla-
tor is a low power oscillator rated up to 200 kHz. It will
continue to run during SLEEP. It is primarily intended
for use with a 32 kHz crystal. Table 6-1 shows the
capacitor selection for the Timer1 oscillator.
The Timer1 oscillator is identical to the LP oscillator.
The user must provide a software time delay to ensure
proper oscillator start-up.

eh meron naman pala nito... pero paano battery management sir marce? or power down nang machine?

Offline marcelino

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6027
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: 16x2 LCD clock using PROTON ???
« Reply #12 on: November 17, 2009, 08:27:22 PM »
eh meron naman pala nito... pero paano battery management sir marce? or power down nang machine?

ewan! heheh ;D

di pa nga ako nakakapag-experiment nito... at yan din ang challenge saakin. ;D ;D ;D
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Offline Mayalin22

  • Hydroelectric
  • ***
  • Posts: 3389
  • Pogi/Ganda Points: 402
  • Gender: Female
Re: 16x2 LCD clock using PROTON ???
« Reply #13 on: November 17, 2009, 09:12:51 PM »
Ganun po ba? for exact timing pala dapat assembly na lang gamitin ko.. huhuhu.. palipat2x ako ng language.. babalik din pala ako sa assembly.. hay..
di mo na kailangan ang assembly... kasi pag kinumpile mo yan ang ipo-produce nyan ay assembly at hex file... very simple lang ang timer sa basic using interrupt. ;)

Code: [Select]
' DEMONSTARTION OF A 100THS OF A SECOND TIMER
' COUNTING UP TO 255 DAYS
'
'
' FIDDLE WITH FUDGE FACTOR TO IMPROVE ACCURACY
'
'-----------------------------------------------
 
Include "PROTON_4.INC"
 
    Dim _100THS As Byte' DECLARE ALL VARS AS BYTES
    Dim SECS    As Byte
    Dim MINS    As Byte
    Dim HOURS   As Byte
    Dim DAYS    As Byte
    Dim TEMP_100THS   As Byte
    Dim TEMP_SECS     As Byte
    Dim TEMP_MINS     As Byte
    Dim TEMP_HOURS    As Byte
    Dim TEMP_DAYS     As Byte
 
    Dim GIE As INTCON.7 ' ALIAS
 
    Dim TIMER1REG As TMR1L.Word ' MAKE THE TIMER VAR INTO A WORD
    Symbol FUDGE_FACTOR = 7 ' FIDDLE WITH TO IMPROVE ACCURACY
    Symbol TMR1_VAL =((65536)-(XTAL*2500))+FUDGE_FACTOR ' CALCULATE OSC OFFSET VALUES FOR 100HZ INTERRUPT
 
    On_Interrupt INTERRUPT_ROUTINE ' WHERE TO GO ON AN INTERRUPT
 
 
    GoTo START ' JUMP THE INTERRUPT CODE
 
INTERRUPT_ROUTINE:
 
    Clear T1CON.0 ' STOP TMR1
    TIMER1REG = TIMER1REG + TMR1_VAL ' LOAD TMR1
    Set T1CON.0 ' START TMR1
       
 
    Inc _100THS
    If _100THS = 100 Then ' UP 100TS
       Clear _100THS
       Inc SECS ' UP SECONDS
       If SECS = 60 Then
          Clear SECS
          Inc MINS ' UP MINS
          If MINS = 60 Then
             Clear MINS
             Inc HOURS
             If HOURS = 24 Then ' UP HOURS
                Clear HOURS
                Inc DAYS
             EndIf
          EndIf
       EndIf
    EndIf
    Clear PIR1.0 ' CLEAR TMR1 INTERRUPT FLAG
    Context Restore ' END INTERRUPT ROUTINE
 
START:
    Clear ' CLEAR ALL VARS
    T1CON = %00000000 ' SET UP TMR1 TO HAVE 1:1 PRESCALER AND ACT AS A TIMER
    PIR1.0 = 0 ' CLEAR TMR1 INTERRUPT FLAG
    INTCON = %11000000 ' GLOBAL AND PERIPHERAL INTERRUPTS ON
    PIE1.0 = 1 ' ENABLE TMR1 AS PERIPHERAL INTERRUPT SOURCE
    T1CON.0 = 1 ' SET TIMER1 RUNNING
 
    Cls ' CLEAR THE LCD
 
    While 1 = 1 ' MAKE AN ENDLESS LOOP
       GIE = 0 ' TURN OFF GLOBAL INTERRUPTS
       While GIE = 1 : GIE = 0 : Wend ' AND MAKE SURE THEY ARE OFF
       TEMP_100THS = _100THS ' MAKE A COPY OF THE VARS
       TEMP_SECS = SECS
       TEMP_MINS = MINS
       TEMP_HOURS = HOURS
       TEMP_DAYS = DAYS
       GIE = 1 ' TURN THE INTERRUPTS BACK ON
 
       Print At 1,1,Dec2 TEMP_DAYS,":",Dec2 TEMP_HOURS,":",Dec2 TEMP_MINS,":",Dec2 TEMP_SECS,":",Dec2 TEMP_100THS
 
       DelayMS 100 ' SMALL DELAU
 
    Wend ' ROUND AND ROUND WE GO
 
    Stop

Simpler designs are usually better.

Offline Born2BeWired

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1123
  • Pogi/Ganda Points: 171
  • Gender: Male
  • Analog and Precision Circuits Junkie
    • e-Gizmo Mechatronix Central
Re: 16x2 LCD clock using PROTON ???
« Reply #14 on: November 17, 2009, 09:36:58 PM »
eh meron naman pala nito... pero paano battery management sir marce? or power down nang machine?

Di ako PIC user, pero I believe i can make an educated guess:

- Enable the hardware interrupt of the timer driven by the 32kHz source.
- Put the MCU in SLEEP Mode or equivalent low power standby mode while it is powered from backup batteries.
- The MCU is awaken for a brief moment everytime an RTC interrupt occurs. This is the period where your RTC interrupt routine does its timekeeping job.
- And then, the MCU is put into sleep mode again.

The average power consumed by the MCU will be very low, allowing it to run on backup batteries for months or even years.

Electronics <- Once you got a taste of it, you will never get enough.

Insanity <- Doing the same thing, expecting different results.

"The more I learn, the more I am humbled."

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1842
  • Pogi/Ganda Points: 53
  • Gender: Male
Re: 16x2 LCD clock using PROTON ???
« Reply #15 on: November 17, 2009, 09:45:24 PM »
di mo na kailangan ang assembly... kasi pag kinumpile mo yan ang ipo-produce nyan ay assembly at hex file... very simple lang ang timer sa basic using interrupt. ;)

Code: [Select]
' DEMONSTARTION OF A 100THS OF A SECOND TIMER
' COUNTING UP TO 255 DAYS
'
'
' FIDDLE WITH FUDGE FACTOR TO IMPROVE ACCURACY
'
'-----------------------------------------------
 
Include "PROTON_4.INC"
 
    Dim _100THS As Byte' DECLARE ALL VARS AS BYTES
    Dim SECS    As Byte
    Dim MINS    As Byte
    Dim HOURS   As Byte
    Dim DAYS    As Byte
    Dim TEMP_100THS   As Byte
    Dim TEMP_SECS     As Byte
    Dim TEMP_MINS     As Byte
    Dim TEMP_HOURS    As Byte
    Dim TEMP_DAYS     As Byte
 
    Dim GIE As INTCON.7 ' ALIAS
 
    Dim TIMER1REG As TMR1L.Word ' MAKE THE TIMER VAR INTO A WORD
    Symbol FUDGE_FACTOR = 7 ' FIDDLE WITH TO IMPROVE ACCURACY
    Symbol TMR1_VAL =((65536)-(XTAL*2500))+FUDGE_FACTOR ' CALCULATE OSC OFFSET VALUES FOR 100HZ INTERRUPT
 
    On_Interrupt INTERRUPT_ROUTINE ' WHERE TO GO ON AN INTERRUPT
 
 
    GoTo START ' JUMP THE INTERRUPT CODE
 
INTERRUPT_ROUTINE:
 
    Clear T1CON.0 ' STOP TMR1
    TIMER1REG = TIMER1REG + TMR1_VAL ' LOAD TMR1
    Set T1CON.0 ' START TMR1
        
 
    Inc _100THS
    If _100THS = 100 Then ' UP 100TS
       Clear _100THS
       Inc SECS ' UP SECONDS
       If SECS = 60 Then
          Clear SECS
          Inc MINS ' UP MINS
          If MINS = 60 Then
             Clear MINS
             Inc HOURS
             If HOURS = 24 Then ' UP HOURS
                Clear HOURS
                Inc DAYS
             EndIf
          EndIf
       EndIf
    EndIf
    Clear PIR1.0 ' CLEAR TMR1 INTERRUPT FLAG
    Context Restore ' END INTERRUPT ROUTINE
 
START:
    Clear ' CLEAR ALL VARS
    T1CON = %00000000 ' SET UP TMR1 TO HAVE 1:1 PRESCALER AND ACT AS A TIMER
    PIR1.0 = 0 ' CLEAR TMR1 INTERRUPT FLAG
    INTCON = %11000000 ' GLOBAL AND PERIPHERAL INTERRUPTS ON
    PIE1.0 = 1 ' ENABLE TMR1 AS PERIPHERAL INTERRUPT SOURCE
    T1CON.0 = 1 ' SET TIMER1 RUNNING
 
    Cls ' CLEAR THE LCD
 
    While 1 = 1 ' MAKE AN ENDLESS LOOP
       GIE = 0 ' TURN OFF GLOBAL INTERRUPTS
       While GIE = 1 : GIE = 0 : Wend ' AND MAKE SURE THEY ARE OFF
       TEMP_100THS = _100THS ' MAKE A COPY OF THE VARS
       TEMP_SECS = SECS
       TEMP_MINS = MINS
       TEMP_HOURS = HOURS
       TEMP_DAYS = DAYS
       GIE = 1 ' TURN THE INTERRUPTS BACK ON
 
       Print At 1,1,Dec2 TEMP_DAYS,":",Dec2 TEMP_HOURS,":",Dec2 TEMP_MINS,":",Dec2 TEMP_SECS,":",Dec2 TEMP_100THS
 
       DelayMS 100 ' SMALL DELAU
 
    Wend ' ROUND AND ROUND WE GO
 
    Stop


tHANK YOU PO SIR COOLET! :-)
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

insomartin

  • Guest
Re: 16x2 LCD clock using PROTON ???
« Reply #16 on: November 17, 2009, 09:49:00 PM »
Di ako PIC user, pero I believe i can make an educated guess:
- Enable the hardware interrupt of the timer driven by the 32kHz source.
- Put the MCU in SLEEP Mode or equivalent low power standby mode while it is powered from backup batteries.
- The MCU is awaken for a brief moment everytime an RTC interrupt occurs. This is the period where your RTC interrupt routine does its timekeeping job.
- And then, the MCU is put into sleep mode again.
The average power consumed by the MCU will be very low, allowing it to run on backup batteries for months or even years.

it would be my first time to implement this two xtal in one mcu interrupt. thanks!  ;D

Offline Mayalin22

  • Hydroelectric
  • ***
  • Posts: 3389
  • Pogi/Ganda Points: 402
  • Gender: Female
Re: 16x2 LCD clock using PROTON ???
« Reply #17 on: November 17, 2009, 09:52:26 PM »
^ sis martin proven na yan.

@ ACE_1989
di ko alam kung sino ang coolet sa atin...  ;D ;D ;D jowk!
Simpler designs are usually better.

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1842
  • Pogi/Ganda Points: 53
  • Gender: Male
Re: 16x2 LCD clock using PROTON ???
« Reply #18 on: November 17, 2009, 10:03:09 PM »
@ ACE_1989
di ko alam kung sino ang coolet sa atin...  ;D ;D ;D jowk!

HEHE.. sensya na po.. ,madami pa po akong tanong :-P
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

Offline marcelino

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6027
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: 16x2 LCD clock using PROTON ???
« Reply #19 on: November 17, 2009, 10:09:45 PM »
Di ako PIC user, pero I believe i can make an educated guess:

- Enable the hardware interrupt of the timer driven by the 32kHz source.
- Put the MCU in SLEEP Mode or equivalent low power standby mode while it is powered from backup batteries.
- The MCU is awaken for a brief moment everytime an RTC interrupt occurs. This is the period where your RTC interrupt routine does its timekeeping job.
- And then, the MCU is put into sleep mode again.

The average power consumed by the MCU will be very low, allowing it to run on backup batteries for months or even years.



hmmmm.... mapag-experimentuhan kaya... tamang tama at my 16LF628A pa ako dito.

papano mag-iimplement ng backup power?
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Philippine Electronics Forum

Re: 16x2 LCD clock using PROTON ???
« Reply #19 on: November 17, 2009, 10:09:45 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com