Changeset 35
- Timestamp:
- 01/03/10 11:19:00 (15 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
webserver/example/EnergyMeters/EnergyMeters/ARM7_LPC2368_Rowley/EnergyMeters.hzs
r34 r35 3 3 <Bookmarks/> 4 4 <Breakpoints> 5 <BreakpointListItem line=" 108" action="" hardwareBreakpoint="" trigger="" useHWbreakpoint="false" group="Breakpoints" type="Breakpoint" state="2" counter="0" isFunctionBreakpoint="false" filename="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" expression="" />5 <BreakpointListItem line="335" action="" hardwareBreakpoint="" trigger="" useHWbreakpoint="false" group="Breakpoints" type="Breakpoint" state="2" counter="0" isFunctionBreakpoint="false" filename="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" expression="" /> 6 6 </Breakpoints> 7 7 <ExecutionCountWindow/> … … 42 42 <Watch1> 43 43 <Watches active="0" update="Three Seconds" > 44 <Watchpoint evalMode="2" linenumber="216" numelements="10" evalType="0" radix="16" name="rxUART3" expression="rxUART3" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 44 <Watchpoint linenumber="64" radix="-1" name="currentTime" expression="currentTime" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" /> 45 <Watchpoint linenumber="445" radix="16" name="PINSEL0" expression="PINSEL0" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 45 46 <Watchpoint evalMode="2" linenumber="72" numelements="10" evalType="0" radix="16" name="meterItems" expression="meterItems" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" /> 46 <Watchpoint linenumber="419" radix="16" name="PINSEL0" expression="PINSEL0" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 47 <Watchpoint linenumber="64" radix="-1" name="currentTime" expression="currentTime" filename="d:/energymetersproject/source/energymeters/meters_isrs.c" /> 47 <Watchpoint evalMode="2" linenumber="229" numelements="10" evalType="0" radix="16" name="rxUART3" expression="rxUART3" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 48 48 </Watches> 49 49 </Watch1> … … 58 58 <Watch4> 59 59 <Watches active="1" update="Five Seconds" > 60 <Watchpoint linenumber=" 86" radix="16" name="compareBuf" expression="compareBuf" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />61 <Watchpoint linenumber="197" radix="16" name="compareBufMask" expression="compareBufMask" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />62 <Watchpoint linenumber=" 197" radix="16" name="compareBuf" expression="compareBuf" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />63 <Watchpoint linenumber="211" radix="16" name="numRxBytes" expression="numRxBytes" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />64 <Watchpoint linenumber="211" radix="16" name="numRxBytes" expression="numRxBytes" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />65 <Watchpoint evalMode="2" linenumber="375" 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" />66 <Watchpoint evalMode="2" linenumber="414" 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" />67 <Watchpoint linenumber="21 1" radix="-1" name="lengthCompare" expression="lengthCompare" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />68 <Watchpoint evalMode="2" linenumber="375" numelements="6" evalType="0" radix="-1" name="chanVolt" expression="chanVolt" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />69 <Watchpoint linenumber=" 214" radix="16" name="k" expression="k" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" />60 <Watchpoint linenumber="227" radix="16" name="k" expression="k" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 61 <Watchpoint evalMode="2" linenumber="389" numelements="6" evalType="0" radix="-1" name="chanVolt" expression="chanVolt" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 62 <Watchpoint linenumber="224" radix="-1" name="lengthCompare" expression="lengthCompare" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 63 <Watchpoint evalMode="2" linenumber="440" 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" /> 64 <Watchpoint evalMode="2" linenumber="389" 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" /> 65 <Watchpoint linenumber="224" radix="16" name="numRxBytes" expression="numRxBytes" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 66 <Watchpoint linenumber="224" radix="16" name="numRxBytes" expression="numRxBytes" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 67 <Watchpoint linenumber="210" radix="16" name="compareBuf" expression="compareBuf" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 68 <Watchpoint linenumber="210" radix="16" name="compareBufMask" expression="compareBufMask" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 69 <Watchpoint linenumber="87" radix="16" name="compareBuf" expression="compareBuf" filename="c:/dokumente und einstellungen/phil/desktop/repo/webserver/example/energymeters/source/energymeters/solarcountuart.c" /> 70 70 </Watches> 71 71 </Watch4> 72 72 <Files> 73 73 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\portISR.c" y="108" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\portable\GCC\ARM7_LPC23xx\portISR.c" left="0" selected="0" name="unnamed" top="85" /> 74 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" y=" 14" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" left="0" selected="1" name="unnamed" top="12" />75 <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="0" name="unnamed" top=" 105" />74 <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" y="35" path="C:\Dokumente und Einstellungen\phil\Desktop\repo\webserver\example\EnergyMeters\Source\EnergyMeters\SolarCountUART.c" left="0" selected="1" name="unnamed" top="35" /> 75 <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="0" name="unnamed" top="96" /> 76 76 </Files> 77 77 <ARMCrossStudioWindow activeProject="EnergyMetersEmbedded" autoConnectTarget="Macraigor Wiggler (20 Pin)" debugSearchFileMap="" fileDialogInitialDirectory="C:\Dokumente und Einstellungen\phil\Desktop\repo\Examples_CP-JR_ARM7_LPC2368\ETT_LPC2368_Examples\PERIPHERAL_DEMO\LED_Blink" fileDialogDefaultFilter="*.c" autoConnectCapabilities="388479" debugSearchPath="" buildConfiguration="ARM Flash Debug" /> webserver/example/EnergyMeters/Source/EnergyMeters/SolarCountUART.c
r34 r35 5 5 // Pin I/O LED Control Maskbit 6 6 #define DIR_RS485 0x00080000 // P1.19(0000 0000 0000 x000 0000 0000 0000 0000) 7 #define RXD_RS485() IOCLR1 = DIR_RS485 // RS485 Direction = 0 (Receive) 8 #define TXD_RS485() IOSET1 = DIR_RS485 // RS485 Direction = 1 (Transmit) 7 9 8 10 9 #define RX_UART3_BUF_SIZE 100 … … 38 37 const unsigned char init1_rsp[] = "\x02\xf0\xb0\x08\x00\x84\x09\x0c\x04\x0a\x26\x86\xcd\x00\x03"; /* exp. init seq response */ 39 38 const unsigned char init1_r_m[] = "\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff"; /* exp. init seq response mask */ 39 /* init1_r_m: response after first init: \x02\xf0\xb0\x08 , later: \x02\xf0\xb0\x09 */ 40 40 41 41 … … 50 50 51 51 const unsigned char init_after_all_chan[] = "\x02\xb0\xf0\x04\x00\x21\x00\xcc\x35\x03"; // send to SC after all channels have been scanned 52 // ^^ equals init1[] 52 53 53 54 const unsigned char init_after_all_chan_rsp[] = "\x02\xf0\xb0\x09\x00\xa1\xfd\x03\x00\x00\x00\x00\x07\x21\x03"; // response from SC to init_after_all_chan[] … … 89 90 90 91 92 void RXD_RS485(void) 93 { 94 IOCLR1 = DIR_RS485; // RS485 Direction = 0 (Receive) 95 } /* RXD_RS485 */ 96 97 void TXD_RS485(void) 98 { 99 delay(500000); 100 IOSET1 = DIR_RS485; // RS485 Direction = 1 (Transmit) 101 } /* TXD_RS485 */ 102 103 91 104 92 105 void testUART3(void) … … 256 269 { 257 270 case SOL_NO_INIT: 271 delay(500000); 258 272 init_serial3(); 259 273 resetUart3RxBuf(); /* init */ … … 261 275 262 276 TXD_RS485(); 277 delay(500000); 263 278 /* send init 1 */ 264 279 send_uart3((unsigned char *)init1, sizeof(init1)); … … 317 332 break; 318 333 case 6: 319 /* we are through with all the channels, send the final init */ 320 send_uart3((unsigned char *)init_after_all_chan, sizeof(init_after_all_chan)); 334 /* we are through with all the channels, ready to send next init for next query round */ 321 335 solarState = SOL_FINISHED; 322 336 break; … … 327 341 if (solarState != SOL_FINISHED) 328 342 { 329 solarState = SOL_CHAN_WAIT_REPLY; 343 solarState = SOL_CHAN_WAIT_REPLY; /* wait for reply if not finished */ 330 344 } /* if */ 331 345 break; … … 373 387 { 374 388 chanVolt[currentChannel] = rxUART3[11]; 375 chanWatt[currentChannel] = (int) rxUART3[7] | (((int)(rxUART3[6])) << 8) /* index 7: LSB, index 6: MSB */;389 chanWatt[currentChannel] = (int)(rxUART3[7]) | (((int)(rxUART3[8])) << 8) /* index 7: LSB, index 8: MSB */; 376 390 } /* if */ 377 /* finally, discard data from buffer */ 378 resetUart3RxBuf(); 379 380 /* switch to next channel */ 381 currentChannel++; 382 /* now ready to query channel data for next channel */ 383 solarState = SOL_CHAN; 391 392 if (currentChannel != 6) 393 { 394 /* we received input from channel 0 to 5 */ 395 396 /* finally, discard data from buffer */ 397 resetUart3RxBuf(); 398 399 /* switch to next channel */ 400 currentChannel++; 401 /* now ready to query channel data for next channel */ 402 solarState = SOL_CHAN; 403 } 404 else 405 { 406 /* we received the finishing sequence */ 407 solarState = SOL_NO_INIT; /* restart the measurement cycle */ 408 } 409 384 410 } 385 411 else … … 495 521 void delay(unsigned long int count1) 496 522 { 497 while(count1 > 0) {count1--;} // Loop Decrease Counter 523 volatile unsigned long int countVol; 524 countVol = count1; 525 while(countVol > 0) {countVol--;} // Loop Decrease Counter 498 526 } 499 527