<?xml version="1.0" encoding="utf-8" ?>
				<!-- generator="e107" -->
				<!-- content type="Forum / topic" -->
				<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
				<channel rdf:about="http://www.8051projects.net/">
				<title>8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes : Forum / topic</title>
				<link>http://www.8051projects.net/</link>
				<description>Learn to make simple microcontroller projects, pic, 8051, avr and arm projects. download 8051 projects, tutorials, libraries, sample codes. join the microcontroller discussion forum and ask doubts regarding electronics. the best source for 8051 over internet.</description>
				<dc:language>en-gb</dc:language>
				<dc:date>2008-12-02T00:30:13-08:00</dc:date>
				<dc:creator>contact@nospam.com</dc:creator>
				<admin:generatorAgent rdf:resource="http://e107.org" />
				<admin:errorReportsTo rdf:resource="mailto:contact@nospam.com" />
				<sy:updatePeriod>hourly</sy:updatePeriod>
				<sy:updateFrequency>1</sy:updateFrequency>
				<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
				<items>
				<rdf:Seq>
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
						<rdf:li rdf:resource="http://www.8051projects.net/forum-t9898.html" />
				</rdf:Seq>
				</items>
				</channel>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator></dc:creator>
						<dc:subject></dc:subject>
						<description>Connecting to MPLAB ICD 2...ConnectedSetting Vdd source to MPLAB ICD 2Target Device PIC12F629 found, revision = Rev 0x10ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF).  Continue?ICD0200: Operation Aborted (Warning 43).MPLAB ICD 2 Ready Having this problem when trying to program the piC12F629 !Help... i successfully programmed 1 of my same pic, but later on i used another pic, when i wan to program it it pops up """"ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF).  Continue?"""""then i put back my another pic, its still the same although i tried it with my 1st pic which was successful, its now also have this warning...any help is very much appreaciated.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Re: Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator>nicholastyc</dc:creator>
						<dc:subject></dc:subject>
						<description>hi Ajay, i already have the most updated firmware. I did nothing wrong , and why when i trying to programme the chip its will pop up this warning!I am trying to program it for the LED dimmer i made the programme for...now wanted to test on it...but cant programme... =(</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Re: Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>try updating the firmware of ICD2.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Re: Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>PIC12F629 is not supported by the ICD2. Also most of the 12-bit instruction targets are not supported by ICD2. So you are getting this error. try replacing it with some other 16F IC and see if problem presist.</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Re: Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator>nicholastyc</dc:creator>
						<dc:subject></dc:subject>
						<description>i need help!!</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Re: Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator>nicholastyc</dc:creator>
						<dc:subject></dc:subject>
						<description>i will try to update you for the result later..if i got time! thanks</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Re: Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator>nicholastyc</dc:creator>
						<dc:subject></dc:subject>
						<description>hi Ajay, i programmed my pic12f629 with pickit2 , but the programme doesnot work at all...i tried to make a simple blinking program..it still doesnot work...i will post the normal turn on led program, i simulated it in mplab sim, it does work to turn on the output!</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Re: Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator>nicholastyc</dc:creator>
						<dc:subject></dc:subject>
						<description>CODE:<br />ERRORLEVEL -302 ;remove message about using proper bank<br /><br />#include &lt;p12f629.inc><br />__CONFIG &nbsp; &nbsp;_MCLRE_OFF &amp; _CP_OFF &amp; _WDT_OFF &amp; _INTRC_OSC_NOCLKOUT &nbsp;<br /><br /><br />START<br />&nbsp; &nbsp; &nbsp; &nbsp; ORG&nbsp; &nbsp; &nbsp;0x000<br />&nbsp; &nbsp; &nbsp; &nbsp; nop<br />&nbsp; &nbsp; &nbsp; &nbsp; nop<br />&nbsp; &nbsp; &nbsp; &nbsp; nop<br />&nbsp; &nbsp; &nbsp; &nbsp; nop<br />&nbsp; &nbsp; &nbsp; &nbsp; nop<br />&nbsp; &nbsp; &nbsp; &nbsp; nop<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,RP0;<br />&nbsp; &nbsp; &nbsp; &nbsp; CLRF&nbsp; &nbsp; GPIO;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;0x07&nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;CMCON&nbsp; &nbsp;;&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;STATUS,RP0&nbsp; &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; movlw &nbsp; &nbsp; b'10000110'&nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; movwf &nbsp; &nbsp; OPTION_REG&nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; &nbsp; 0x3FF;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;OSCCAL;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW 0x08;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF TRISIO;<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,RP0;<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,C;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;0x08;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;GPIO;<br />LOOP<br />&nbsp; &nbsp; &nbsp; &nbsp; bsf GPIO,0<br />&nbsp; &nbsp; &nbsp; &nbsp; bcf GPIO,1<br />&nbsp; &nbsp; &nbsp; &nbsp; bsf GPIO,2<br />&nbsp; &nbsp; &nbsp; &nbsp; goto LOOP<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; org&nbsp; &nbsp; &nbsp;0x3ff<br />&nbsp; &nbsp; &nbsp; &nbsp; movlw&nbsp; &nbsp;0x20<br /><br />end<br /><br />&nbsp;there is no ; between _MCLRE_OFF &amp; _CP_OFF  in my code...why when i attach, it appears...</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Re: Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator>nicholastyc</dc:creator>
						<dc:subject></dc:subject>
						<description>CODE:;********************************************<br />;***Title:Led Light Dimmer VERSION 2*********<br />;*Author:YC THAM*****************************<br />;**Date:12/6/2008****************************<br />;********************************************<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; ERRORLEVEL -302 ;remove message about using proper bank<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; #include &lt;p12f629.inc><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;__CONFIG &nbsp; &nbsp; &nbsp; _CP_OFF &amp; _MCLRE_OFF &amp; _WDT_OFF &amp; _INTRC_OSC_NOCLKOUT &amp; _BODEN_OFF &amp; _CPD_OFF &amp;_PWRTE_OFF<br /><br />ORIGINAL_PWM&nbsp; &nbsp; EQU&nbsp; &nbsp; &nbsp;H'0020'<br />COUNT50&nbsp;EQU&nbsp; &nbsp; &nbsp;H'0021'<br />TEMP&nbsp; &nbsp; EQU&nbsp; &nbsp; &nbsp;H'0022'<br />A11&nbsp; &nbsp; &nbsp;EQU&nbsp; &nbsp; &nbsp;H'0023'<br />A21&nbsp; &nbsp; &nbsp;EQU&nbsp; &nbsp; &nbsp;H'0024'<br />GPIO EQU H'0005'<br />TRISIO&nbsp; EQU&nbsp; &nbsp; &nbsp;H'0085'<br /><br />;******MAIN********<br />&nbsp; &nbsp; &nbsp; &nbsp; ORG&nbsp; &nbsp; &nbsp;0x000<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,RP0; bank 0<br />&nbsp; &nbsp; &nbsp; &nbsp; CLRF&nbsp; &nbsp; GPIO;&nbsp; &nbsp;clear gpio<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;07h&nbsp; &nbsp; &nbsp;;&nbsp; &nbsp; &nbsp; &nbsp;set to digital I/O<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;CMCON&nbsp; &nbsp;;&nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;STATUS,RP0&nbsp; &nbsp; &nbsp; ;&nbsp; &nbsp; &nbsp; &nbsp;bank 1<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; &nbsp; 3FFh;&nbsp; &nbsp;calibrate the internal oscillator<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;OSCCAL;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW H'0038';&nbsp; set the gp3,4,5 as input, gp0,1,2 as output<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF TRISIO;<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,5;bank 0<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,C;clear carry flag<br />START<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSS&nbsp; &nbsp;GPIO,3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; wait for On/OFF switch input<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; START;&nbsp; loop for input<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; &nbsp; PREVIOUS&nbsp; &nbsp; &nbsp; &nbsp; ;restore previous saved PWM<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; INITIAL_PWM&nbsp; &nbsp; &nbsp;;go to pwm output loop<br /><br />INITIAL_PWM<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;0x38&nbsp; &nbsp; ; set 0x38input<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;GPIO&nbsp; &nbsp; ;<br />RESTART_PWM<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVF&nbsp; &nbsp; ORIGINAL_PWM,w&nbsp; ; move original_pwm register data to w<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;TEMP&nbsp; &nbsp; ;move w to temp register<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;GPIO,0&nbsp; ;turn on output gp0, cool white, HI<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSS&nbsp; &nbsp;GPIO,1&nbsp; ;check for gp1 condition<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; &nbsp; DELAY&nbsp; &nbsp;;delay phase shift<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;GPIO,1&nbsp; ;turn on output gp1, warm white, HI<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSS&nbsp; &nbsp;GPIO,2&nbsp; ;chec for gp2 condition<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; &nbsp; DELAY&nbsp; &nbsp;;delay phase shift<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;GPIO,2&nbsp; ;turn on output gp2, amber, HI<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;d'255';test on the pwm condition<br />&nbsp; &nbsp; &nbsp; &nbsp; ADDWF&nbsp; &nbsp;ORIGINAL_PWM,0;prevent loop on 0 pwm<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSS&nbsp; &nbsp;STATUS,C;if pwm cycle >0 , loop for the cycles time<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; LOOP1;skip cycle count loop<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,C; clear carry flag<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; LOOP0;goto cycle count loop<br />LOOP0&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; DECFSZ&nbsp; TEMP,1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;cycle count HI loop<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; LOOP0&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;<br />LOOP1&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;d'255'&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;total possible cycles, 255<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;TEMP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;move to temp register for counter loop<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVF&nbsp; &nbsp; ORIGINAL_PWM,w&nbsp; ;move original pwm to w for sub<br />&nbsp; &nbsp; &nbsp; &nbsp; SUBWF&nbsp; &nbsp;TEMP,1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;sub temp with original pwm<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;GPIO,0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;turn gp0 to low<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSC&nbsp; &nbsp;GPIO,1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check for gp1 condition<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; &nbsp; DELAY&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;delay phase shift<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;GPIO,1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;turn gp1 to low<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSC&nbsp; &nbsp;GPIO,2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check for gp2 condition<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; &nbsp; DELAY&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;delay phase shift<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;GPIO,2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;turn gp2 to low<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,C&nbsp; &nbsp; &nbsp; &nbsp; ;clear carry flag<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;d'255';test on pwm condition<br />&nbsp; &nbsp; &nbsp; &nbsp; ADDWF&nbsp; &nbsp;TEMP,0;prevent loop on 0 pwm<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSS STATUS,C;if pwm cycle >0 loop for cycles time<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO LOOP3;skip loop<br />LOOP2&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; DECFSZ&nbsp; TEMP,1&nbsp; ;loop for cycle count<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; LOOP2&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;<br />LOOP3<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSS&nbsp; &nbsp;GPIO,3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check on switch on/off<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; START&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;back to start if off, continue if on<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSC&nbsp; &nbsp;GPIO,4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check for the new pwm cycle changes<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; &nbsp; SHAFT_0&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;increase/decrease on pwm cycle<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RESTART_PWM&nbsp; &nbsp; &nbsp;;continue loop for the current condition<br /><br />;*********************************************<br />;** SUB-ROUTINE*******************************<br />;*********************************************<br /><br />PREVIOUS:<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;STATUS,5&nbsp; &nbsp; &nbsp; &nbsp; ; bank1<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;0x10;eeprom address for saving data<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;EEADR;go to address above 0x10<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;EECON1,RD&nbsp; &nbsp; &nbsp; &nbsp;;read data in address<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVF&nbsp; &nbsp; EEDATA,w&nbsp; &nbsp; &nbsp; &nbsp; ;recall data to w register<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,5;bank0<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;ORIGINAL_PWM;save to original_pwm register<br />&nbsp; &nbsp; &nbsp; &nbsp; RETURN<br /><br />;****************************************<br />;**SAVE PWM IN EEPROM********************<br />;****************************************<br /><br />SAVE_PWM:<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;STATUS,5; bank 1<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;0x10;address to save data<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;EEADR;go to addr 0x10<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVF&nbsp; &nbsp; ORIGINAL_PWM,w&nbsp; ;move data on original_pwm to w<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;EEDATA;send the data to eeprom<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;EECON1,WREN&nbsp; &nbsp; &nbsp;;write enable<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;INTCON,GIE&nbsp; &nbsp; &nbsp; ;clear interrupt<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;H'0055'&nbsp;;&lt;eeprom write sequence<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;EECON2&nbsp; ;&lt;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;H'00AA' ;&lt;<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;EECON2&nbsp; ;&lt;<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;EECON1,WR&nbsp; &nbsp; &nbsp; &nbsp;;write in progress<br />LOOP_WR<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSC&nbsp; &nbsp;EECON1,WR; test for write process complete>?<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; LOOP_WR;if not complete loop till complete to ensure write successfully<br />&nbsp; &nbsp; &nbsp; &nbsp; BSF&nbsp; &nbsp; &nbsp;INTCON,GIE&nbsp; &nbsp; &nbsp; ;enable interrupt<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;EECON1, WREN;disable write<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,5;bank 0<br />&nbsp; &nbsp; &nbsp; &nbsp; RETURN<br /><br />;***************************************************<br />;****DELAY******************************************<br />;***************************************************<br />DELAY:<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;d'50'; number of phase shifting loop<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;COUNT50;<br />COUNT<br />&nbsp; &nbsp; &nbsp; &nbsp; DECFSZ&nbsp; COUNT50,1; loop for 50 cycles<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; COUNT;<br />&nbsp; &nbsp; &nbsp; &nbsp; RETURN<br />;**********************************************<br />;**DIRECTION***********************************<br />;**********************************************<br /><br />SHAFT_0:<br />&nbsp; &nbsp; &nbsp; &nbsp; CLRF&nbsp; &nbsp; A11&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;clear A11 register<br />&nbsp; &nbsp; &nbsp; &nbsp; CLRF&nbsp; &nbsp; A21&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;clear A21 register<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,C;clear carry flag<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSC&nbsp; &nbsp;GPIO,4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check on gp4<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SAVEBIT_A11&nbsp; &nbsp; &nbsp;;goto gp4=1 1st bit<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SAVEBIT_A10&nbsp; &nbsp; &nbsp;;goto gp4=0<br />SHAFT_1<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSC&nbsp; &nbsp;GPIO,5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check on gp5<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SAVEBIT_B11&nbsp; &nbsp; &nbsp;;goto gp5=1 2nd bit<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SAVEBIT_B10&nbsp; &nbsp; &nbsp;;goto gp5=0<br />SHAFT_2<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSC&nbsp; &nbsp;GPIO,4&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check on gp4<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SAVEBIT_A21&nbsp; &nbsp; &nbsp;;goto gp4=1 3rd bit<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SAVEBIT_A20&nbsp; &nbsp; &nbsp;;goto gp4=0 <br />SHAFT_3<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSC&nbsp; &nbsp;GPIO,5&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;check on gp5<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SAVEBIT_B21&nbsp; &nbsp; &nbsp;;goto gp5=1 4th bit<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SAVEBIT_B20&nbsp; &nbsp; &nbsp;;goto gp5=0<br />SAVEBIT_A11<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;b'00000001'&nbsp; &nbsp; &nbsp;;gp4=1 1st bit =1<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;A11&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;move to register A11<br />&nbsp; &nbsp; &nbsp; &nbsp; RLF&nbsp; &nbsp; &nbsp;A11,1&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;rotate left to make 4bit table check up!<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SHAFT_1&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;back to 2nd bit check<br />SAVEBIT_A10<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;b'00000000'&nbsp; &nbsp; &nbsp;;gp4=0 1st bit =0<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;A11&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;move to register A11<br />&nbsp; &nbsp; &nbsp; &nbsp; RLF&nbsp; &nbsp; &nbsp;A11,1&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;rotate left to make 4bit table check up<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SHAFT_1&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;back to 2nd bit check<br />SAVEBIT_B11<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;b'00000001'&nbsp; &nbsp; &nbsp;;gp5=1 2nd bit =1<br />&nbsp; &nbsp; &nbsp; &nbsp; IORWF&nbsp; &nbsp;A11,1&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;inclusive or on A11 1st bit , result &lt;00000011>/&lt;00000001><br />&nbsp; &nbsp; &nbsp; &nbsp; RLF&nbsp; &nbsp; &nbsp;A11,1&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;rotate left to make 4 bit table check up<br />&nbsp; &nbsp; &nbsp; &nbsp; RLF A11,1&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;rotate again to become 4bit<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SHAFT_2&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;back to 3rd bit check<br />SAVEBIT_B10<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;b'00000000'&nbsp; &nbsp; &nbsp;;gp5=0 2rd bit =0<br />&nbsp; &nbsp; &nbsp; &nbsp; IORWF&nbsp; &nbsp;A11,1&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;inclusive or on A11 1stbit &nbsp;result &lt;00000000>/&lt;00000010><br />&nbsp; &nbsp; &nbsp; &nbsp; RLF&nbsp; &nbsp; &nbsp;A11,1&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;rotate left to make 4 bit table check<br />&nbsp; &nbsp; &nbsp; &nbsp; RLF A11,1&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;rotate again to become 4bit<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SHAFT_2&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;back to 3rd bit check<br />SAVEBIT_A21<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;b'00000001'&nbsp; &nbsp; &nbsp;;gp4=1 3rd bit =1<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;A21&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;move to register A21<br />&nbsp; &nbsp; &nbsp; &nbsp; RLF&nbsp; &nbsp; &nbsp;A21,1&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;rotate left to make 4bit table check up<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SHAFT_3&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;back to 4th bit check<br />SAVEBIT_A20<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;b'00000000'&nbsp; &nbsp; &nbsp;;gp4=0 3rd bit =0<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;A21&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;move to register A21<br />&nbsp; &nbsp; &nbsp; &nbsp; RLF&nbsp; &nbsp; &nbsp;A21,1&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;rotate left again<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; SHAFT_3&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;back to 4th bit check<br />SAVEBIT_B21<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;b'00000001'&nbsp; &nbsp; &nbsp;;gp5=1 4th bit = 1<br />&nbsp; &nbsp; &nbsp; &nbsp; IORWF&nbsp; &nbsp;A21,0&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;inclusive or A21 3rd bit<br />&nbsp; &nbsp; &nbsp; &nbsp; IORWF&nbsp; &nbsp;A11,0&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;inclusive or with A11 to make up 4th bit<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; DIRECTION&nbsp; &nbsp; &nbsp; &nbsp;; check on direction<br />SAVEBIT_B20<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;b'00000000'&nbsp; &nbsp; &nbsp;; gp5=1 4th bit =1<br />&nbsp; &nbsp; &nbsp; &nbsp; IORWF&nbsp; &nbsp;A21,0&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;inclusive or A21 3rd bit<br />&nbsp; &nbsp; &nbsp; &nbsp; IORWF&nbsp; &nbsp;A11,0&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;IOR with A11 to make up 4th bit<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; DIRECTION&nbsp; &nbsp; &nbsp; &nbsp;;check for direction<br />DIRECTION<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; &nbsp; TABLE_1&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; ;direction look up table <br />ANTI_CLOCKWISE<br />&nbsp; &nbsp; &nbsp; &nbsp; DECF&nbsp; &nbsp; ORIGINAL_PWM,f&nbsp; ; anti-clockwise means decrease on pwm cycle<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;d'255'; to prevent decrease more than 0 cycle condition, turn to 255 cycle<br />&nbsp; &nbsp; &nbsp; &nbsp; SUBWF&nbsp; &nbsp;ORIGINAL_PWM,0; sub original_pwm<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSC&nbsp; &nbsp;STATUS,C; check on carry flag if cycle >0 , carry appears<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RELOADZERO; if it is 0, reload zero to original_pwm register<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; NORMAL;if not, continue to save<br />RELOADZERO<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;d'0'; load 0 to pwm due to over decrease happened<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;ORIGINAL_PWM; move to register<br />&nbsp; &nbsp; &nbsp; &nbsp; BCF&nbsp; &nbsp; &nbsp;STATUS,C;clear carry flag<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; NORMAL;continue to save pwm<br />NORMAL<br />&nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; &nbsp; SAVE_PWM&nbsp; &nbsp; &nbsp; &nbsp; ; call save pwm routine to save pwm data for recall on start up<br />&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;GOTO&nbsp; &nbsp; RESTART_PWM&nbsp; &nbsp; &nbsp;;return from save and continue to generate pwm signal<br />CLOCKWISE<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;d'1'; clockwise means increase on pwm cycle<br />&nbsp; &nbsp; &nbsp; &nbsp; ADDWF&nbsp; &nbsp;ORIGINAL_PWM,0; add to the register to prevent over increment happned(more than 255)<br />&nbsp; &nbsp; &nbsp; &nbsp; BTFSC&nbsp; &nbsp;STATUS,C;it will turn to 0 cycle if over increment<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RELOAD255; reload 255 cycle <br />&nbsp; &nbsp; &nbsp; &nbsp; INCF&nbsp; &nbsp; ORIGINAL_PWM,f&nbsp; ;increase pwm if no over increment condition happened<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; NORMAL;continue to save pwm<br />RELOAD255<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVLW&nbsp; &nbsp;d'255'; load 255 to resigter due to over increment to 0 in w register<br />&nbsp; &nbsp; &nbsp; &nbsp; MOVWF&nbsp; &nbsp;ORIGINAL_PWM; move to resigter<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; NORMAL;continue to save pwm<br />&nbsp; &nbsp; &nbsp; &nbsp; RETURN<br />;************************************************<br />;**** DIRECTION TABLE****************************<br />;************************************************<br /><br />TABLE_1:<br />&nbsp; &nbsp; &nbsp; &nbsp; ADDWF&nbsp; &nbsp;PCL,1&nbsp; &nbsp;; add the result to pc, result is from 4th bit generated<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RESTART_PWM&nbsp; &nbsp; &nbsp;; no increment nor decrement<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; ANTI_CLOCKWISE&nbsp; ; decrease on pwm<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; CLOCKWISE&nbsp; &nbsp; &nbsp; &nbsp;;increase on pwm<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RESTART_PWM&nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; CLOCKWISE&nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RESTART_PWM&nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RESTART_PWM&nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; ANTI_CLOCKWISE&nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; ANTI_CLOCKWISE&nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RESTART_PWM&nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RESTART_PWM&nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; CLOCKWISE&nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RESTART_PWM&nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; CLOCKWISE&nbsp; &nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; ANTI_CLOCKWISE&nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; GOTO&nbsp; &nbsp; RESTART_PWM&nbsp; &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; RETURN<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; END<br />&nbsp;</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Re: Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator>nicholastyc</dc:creator>
						<dc:subject></dc:subject>
						<description>hi Ajay, i am really scratching my head, i already programmed my code above to my pic...i tested my code on MPLAB SIM, it worked totally fine with what i expected.But it dont work after i programmed the code into pic...wat;s the problem with setting??????thanks!</description>
						</item>
						<item rdf:about="http://www.8051projects.net/forum-t9898.html">
						<title>Re: Help on ICDWarn0044:  Target has an invalid calibration memory value (0x3FFF)</title>
						<link>http://www.8051projects.net/forum-t9898.html</link>
						<dc:date>2008-12-02T00:30:13-08:00</dc:date>
						<dc:creator>Ajay</dc:creator>
						<dc:subject></dc:subject>
						<description>are you working with a development board? or a self constructed board?</description>
						</item>
				</rdf:RDF>