Show
Ignore:
Timestamp:
02/21/10 13:21:41 (15 years ago)
Author:
phil
Message:

added watchdog

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/EnergyMeters.hzs

    r46 r53  
    2121  <ProjectSessionItem path="EnergyMetersEmbedded;EnergyMetersEmbedded;Demo Source" name="unnamed" /> 
    2222  <ProjectSessionItem path="EnergyMetersEmbedded;EnergyMetersEmbedded;EnergyMeters" name="unnamed" /> 
    23   <ProjectSessionItem path="EnergyMetersEmbedded;EnergyMetersEmbedded;uIP Source" name="unnamed" /> 
    2423 </Project> 
    2524 <Register1> 
     
    5857  <Watches active="1" update="Twice a Second" > 
    5958   <Watchpoint evalMode="2" linenumber="539" numelements="100" evalType="0" radix="-1" name="rxUART3" expression="rxUART3" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    60    <Watchpoint evalMode="1" linenumber="607" evalType="1" radix="-1" name="data" expression="data" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    61    <Watchpoint linenumber="235" radix="-1" name="cRxedChar" expression="cRxedChar" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/common/full/comtest.c" /> 
     59   <Watchpoint linenumber="53" radix="16" name="currentChannel" expression="currentChannel" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     60   <Watchpoint evalMode="2" linenumber="488" numelements="6" evalType="0" radix="-1" name="chanWatt" expression="chanWatt" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    6261   <Watchpoint evalMode="2" linenumber="488" numelements="6" evalType="0" radix="11" name="chanVolt" expression="chanVolt" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    63    <Watchpoint evalMode="0" linenumber="340" evalType="1" radix="-1" name="uip_appdata" expression="uip_appdata" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd-cgi.c" /> 
     62   <Watchpoint evalMode="0" linenumber="396" evalType="1" radix="-1" name="uip_appdata" expression="uip_appdata" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd-cgi.c" /> 
    6463   <Watchpoint evalMode="2" linenumber="111" numelements="11" evalType="0" radix="-1" name="meterItems" expression="meterItems" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/meters_isrs.c" /> 
    6564   <Watchpoint linenumber="109" radix="16" name="solarReadErrors" expression="solarReadErrors" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     
    6867   <Watchpoint linenumber="637" radix="-1" name="ch" expression="ch" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    6968   <Watchpoint linenumber="216" radix="16" name="RxBuf" expression="RxBuf" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    70    <Watchpoint evalMode="0" linenumber="340" evalType="1" radix="16" name="uip_appdata" expression="uip_appdata" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd-cgi.c" /> 
     69   <Watchpoint evalMode="0" linenumber="396" evalType="1" radix="16" name="uip_appdata" expression="uip_appdata" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd-cgi.c" /> 
    7170   <Watchpoint linenumber="205" radix="-1" name="byteReceived" expression="byteReceived" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    72    <Watchpoint linenumber="53" radix="16" name="currentChannel" expression="currentChannel" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    73    <Watchpoint evalMode="2" linenumber="488" numelements="6" evalType="0" radix="-1" name="chanWatt" expression="chanWatt" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
    74    <Watchpoint linenumber="242" radix="16" name="METER_INDEX_GAS" expression="METER_INDEX_GAS" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd-cgi.c" /> 
     71   <Watchpoint evalMode="1" linenumber="607" evalType="1" radix="-1" name="data" expression="data" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 
     72   <Watchpoint linenumber="235" radix="-1" name="cRxedChar" expression="cRxedChar" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/common/full/comtest.c" /> 
     73   <Watchpoint linenumber="245" radix="16" name="METER_INDEX_GAS" expression="METER_INDEX_GAS" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/energymeters/arm7_lpc2368_rowley/webserver/httpd-cgi.c" /> 
    7574  </Watches> 
    7675 </Watch4> 
    7776 <Files> 
    78   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\Meters.c" y="146" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\Meters.c" left="0" selected="0" name="unnamed" top="131" /> 
    79   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\main.c" y="113" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\main.c" left="0" selected="1" name="unnamed" top="113" /> 
    80   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\MetersIncludes.h" y="8" path="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\MetersIncludes.h" left="0" selected="0" name="unnamed" top="0" /> 
    81   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="35" debugPath="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\Meters_ISRs.c" y="39" path="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\Meters_ISRs.c" left="0" selected="0" name="unnamed" top="19" /> 
    82   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\timeConversion.c" y="53" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\timeConversion.c" left="0" selected="0" name="unnamed" top="32" /> 
     77  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="4" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\Meters.c" y="75" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\Meters.c" left="0" selected="1" name="unnamed" top="59" /> 
     78  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="17" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\main.c" y="278" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\main.c" left="0" selected="0" name="unnamed" top="267" /> 
     79  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\MetersIncludes.h" y="9" path="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\MetersIncludes.h" left="0" selected="0" name="unnamed" top="15" /> 
     80  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\Meters_ISRs.c" y="93" path="C:\dokumente und einstellungen\phil\desktop\repo\webserver\example\energymeters\source\energymeters\Meters_ISRs.c" left="0" selected="0" name="unnamed" top="51" /> 
     81  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="4" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\timeConversion.c" y="33" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\timeConversion.c" left="0" selected="0" name="unnamed" top="0" /> 
    8382  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\Philips_LPC230X_Startup.s" y="277" path="C:\Dokumente und Einstellungen\phil\Lokale Einstellungen\Anwendungsdaten\Rowley Associates Limited\CrossWorks for ARM\packages\targets\Philips_LPC210X\Philips_LPC230X_Startup.s" left="0" selected="0" name="unnamed" top="262" /> 
    8483  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\LCD\portlcd.c" y="279" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\LCD\portlcd.c" left="0" selected="0" name="unnamed" top="264" /> 
    85   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\tasks.c" y="1890" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\tasks.c" left="0" selected="0" name="unnamed" top="1882" /> 
     84  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\tasks.c" y="1072" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\tasks.c" left="0" selected="0" name="unnamed" top="1060" /> 
    8685  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\FreeRTOSConfig.h" y="82" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\FreeRTOSConfig.h" left="0" selected="0" name="unnamed" top="62" /> 
    8786  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\include\FreeRTOS.h" y="251" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\include\FreeRTOS.h" left="0" selected="0" name="unnamed" top="241" /> 
    88   <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\Minimal\flash.c" y="159" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\Minimal\flash.c" left="0" selected="0" name="unnamed" top="141" /> 
     87  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\Minimal\flash.c" y="164" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\Minimal\flash.c" left="0" selected="0" name="unnamed" top="148" /> 
     88  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" y="290" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\httpd-cgi.c" left="0" selected="0" name="unnamed" top="260" /> 
     89  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\ethernet\uIP\uip-1.0\uip\uip_arp.c" y="114" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\ethernet\uIP\uip-1.0\uip\uip_arp.c" left="0" selected="0" name="unnamed" top="99" /> 
     90  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\ethernet\uIP\uip-1.0\uip\uipopt.h" y="348" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\Common\ethernet\uIP\uip-1.0\uip\uipopt.h" left="0" selected="0" name="unnamed" top="333" /> 
     91  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\uip-conf.h" y="0" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\EnergyMeters\ARM7_LPC2368_Rowley\webserver\uip-conf.h" left="0" selected="0" name="unnamed" top="127" /> 
     92  <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="16" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\include\targets\LPC23xx.h" y="817" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\include\targets\LPC23xx.h" left="0" selected="0" name="unnamed" top="799" /> 
    8993 </Files> 
    90  <ARMCrossStudioWindow activeProject="EnergyMetersEmbedded" autoConnectTarget="Macraigor Wiggler (20 Pin)" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388479" debugSearchPath="" buildConfiguration="ARM Flash Debug" /> 
     94 <ARMCrossStudioWindow activeProject="EnergyMetersEmbedded" autoConnectTarget="Macraigor Wiggler (20 Pin)" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388479" debugSearchPath="" buildConfiguration="ARM Flash Release" /> 
    9195</session> 
  • webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/main.c

    r45 r53  
    7575void setRTC(void); 
    7676void startRTC(void); 
     77void feedWatchdog(void); 
     78void startWatchdog(void); 
    7779 
    7880/* 
     
    113115int main (void) 
    114116{ 
     117 
     118  startWatchdog(); 
    115119  startRTC(); /* start the RTC */ 
    116120 
     
    268272  RTC_CCR |= 0x00000001; // Start RTC Clock      
    269273} 
     274 
     275 
     276void startWatchdog(void) 
     277{ 
     278  WDCLKSEL = 2; /* feed Watchdog from RTC */ 
     279  WDTC = 32768*10; /* timeout value (gets multiplied x4) */ 
     280  WDMOD = 3; /* WDEN and WDRESET: reset microcontroller in case of time-out */ 
     281 
     282  /* activate watchdog */ 
     283  feedWatchdog(); 
     284 
     285} 
     286 
     287void feedWatchdog(void) 
     288{ 
     289    portENTER_CRITICAL(); 
     290    WDFEED = 0xAA; 
     291    WDFEED = 0x55; 
     292    portEXIT_CRITICAL(); 
     293 } 
  • webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c

    r52 r53  
    7272 
    7373    xSemaphoreTake( xMetersSemaphore, 1000 ); /* timeout 1 sec */ 
     74 
     75 
     76    feedWatchdog(); /* we need to feed the watchdog regularly */ 
    7477 
    7578          /* Yield in case cooperative scheduling is being used. */