| ??? 05/10/06 14:14 Read: times |
#115939 - His new code Responding to: ???'s previous message |
Since he didn't take any of the advice that was given him, he probably won't post the code either. So here it is.
Jon $MOD51 ;************************************************************** ;************************************************************** ;** ** ;**---------------INTELLIGENT UPS PROJECT--------------------** ;** Inverter Module Software ** ;************************************************************** ;*************ADVISOR: Prof. Dr. Eyup AKPINAR****************** ;** ** ;**-----------------------DESIGNERS--------------------------** ;** BATU CURA ** ;** FUAD SOLTANOV ** ;** HASIM TURGUT ** ;************************************************************** ;** ** ;**------------MicroController Family:ATMEL80C51-------------** ;** ** ;************************************************************** ;************************************************************** ;(((((((((((((((((((((((MAIN PROGRAM))))))))))))))))))))))))))) ORG 00H AJMP START ;(((((((((((((((((INTERRUPT SUB-PROGRAM)))))))))))))))))))))))) ORG 03H ACALL DECIDE RETI ORG 13H LCALL STOP RETI ;(((((((((((((((((((MAIN PROGRAM START))))))))))))))))))))))))) START: ANL P1,#83H MOV IE,#85H MOV IP,#01H ;ZERO CROSS INT. PRIORTY HIGH MOV TCON,#00H MOV R1,#00H ;INT0 FALLING EDGE YAPILDI MOV R4,#00H ORG 27H TEKRAR: CJNE R4,#01,DRIVE1 MOV R4,#02H AJMP NEGCYCLE DRIVE1: CJNE R4,#02,REPEAT MOV R4,#01H AJMP POSCYCLE REPEAT: NOP CJNE R4,#00,TEKRAR AJMP REPEAT ;(((((((((((((((((((PWM SIGNAL GENERATORS)))))))))))))))))))))) ;<<<<<<<<<<<<<<<<<<<<<<POSITIVE CYCLE>>>>>>>>>>>>>>>>>>>>>>>>>> POSCYCLE: MOV IE,#00H MOV IE,#85H CLR P1.4 CLR P1.2 CALL DELAY SETB P1.5 SETB P1.3 CALL DELAY2 CLR P1.2 CLR P1.4 CALL DELAY MOV R3,#1BH FWAIT2: NOP DJNZ R3,FWAIT2 CONTROL1: JB P1.0,GOON1 CLR P1.3 CALL DELAY SETB P1.2 CALL DELAY2 AJMP CONTROL1 GOON1: CLR P1.2 CALL DELAY SETB P1.3 CALL DELAY2 AJMP CONTROL1 ;<<<<<<<<<<<<<<<<<<<<<<NEGATIVE CYCLE>>>>>>>>>>>>>>>>>>>>>>>>>>> NEGCYCLE: MOV IE,#00H MOV IE,#85H CLR P1.5 CLR P1.3 CALL DELAY SETB P1.4 SETB P1.2 NOP NOP MOV R3,#1BH FWAIT1: NOP DJNZ R3,FWAIT1 AGAIN: JB P1.1,CONTROL2 CLR P1.2 CALL DELAY2 SETB P1.3 CALL DELAY2 AJMP AGAIN CONTROL2: SETB P1.2 NOP NOP CLR P1.3 CALL DELAY AJMP AGAIN DELAY: MOV B,#0CH DO: NOP DJNZ B,DO RET DELAY2: MOV B,#07H DO2: NOP DJNZ B,DO2 RET ;>>>>>>>>>>>>>>>>>>>>>>>>>>>ALARM<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ORG 00B9H MOV IE,#00H MOV R4,#00H ACALL REPEAT ;((((((((((((((((((((((((INTERRUPT PROGRAM)))))))))))))))))))))) SPECIFY: JNB P1.0,YES1 JNB P1.1,NO3 AJMP SPECIFY YES1: JNB P1.1,YES2 NO2: MOV R4,#02H MOV R1,#0FFH RET YES2: JNB P1.0,YES3 NO3: MOV R4,#01H MOV R1,#0FFH RET YES3: JNB P1.1,YES4 AJMP NO2 YES4: AJMP YES2 ;<<<<<<<<<<<<<<<<<<<<CYCLE BRANCHING>>>>>>>>>>>>>>>>>>>>>>>>>>> DECIDE: CJNE R1,#00H,SAYKIL ACALL SPECIFY RET SAYKIL: MOV 32H,#27H MOV 31H,#00H POP DPH POP DPL PUSH 32H PUSH 31H RET STOP: ANL P1,#43H SETB P1.6 POP DPH POP DPL MOV 33H,#0B9H MOV 34H,#00H MOV R4,#01H PUSH 33H PUSH 34H RETI END |
| Topic | Author | Date |
| I'm in trouble with my PWM software | 01/01/70 00:00 | |
| Interrupts ? | 01/01/70 00:00 | |
| Firstly I want to explain how my hardwar | 01/01/70 00:00 | |
| 89C52 | 01/01/70 00:00 | |
| use a uC with a PCA | 01/01/70 00:00 | |
| wiggling with the stack pointer | 01/01/70 00:00 | |
| I know that.... | 01/01/70 00:00 | |
| no you don't | 01/01/70 00:00 | |
| To: Erik | 01/01/70 00:00 | |
| My code | 01/01/70 00:00 | |
| I can't tell | 01/01/70 00:00 | |
| His Code | 01/01/70 00:00 | |
| Nicely formatted | 01/01/70 00:00 | |
| As Erik suggested | 01/01/70 00:00 | |
| not valuable | 01/01/70 00:00 | |
| Hard to understand | 01/01/70 00:00 | |
| asking for? | 01/01/70 00:00 | |
| Weird DNA.... | 01/01/70 00:00 | |
| that does make a difference | 01/01/70 00:00 | |
| Playing with The Stack Pointer | 01/01/70 00:00 | |
| Thanks | 01/01/70 00:00 | |
| ORG 33H | 01/01/70 00:00 | |
| OK | 01/01/70 00:00 | |
| replying to what in the above refer to m | 01/01/70 00:00 | |
| Listen and learn | 01/01/70 00:00 | |
| excellent question | 01/01/70 00:00 | |
| I'm listening and learning | 01/01/70 00:00 | |
| Oops | 01/01/70 00:00 | |
| Rewrite ! | 01/01/70 00:00 | |
| WRONG | 01/01/70 00:00 | |
| Basic methods & specific details | 01/01/70 00:00 | |
| To:Neil | 01/01/70 00:00 | |
| +ve&-ve | 01/01/70 00:00 | |
| totally unnneded information | 01/01/70 00:00 | |
| +ve | 01/01/70 00:00 | |
| Me too | 01/01/70 00:00 | |
| halfway | 01/01/70 00:00 | |
| Just like the first time I saw 3v3 | 01/01/70 00:00 | |
| Mid 70's | 01/01/70 00:00 | |
| the reason | 01/01/70 00:00 | |
| Yes - Very Well Established | 01/01/70 00:00 | |
| the trouble is | 01/01/70 00:00 | |
| Other calls | 01/01/70 00:00 | |
| One thing for the future | 01/01/70 00:00 | |
| I do not see the point | 01/01/70 00:00 | |
| I got bored... | 01/01/70 00:00 | |
| argh, so many nops | 01/01/70 00:00 | |
| NOP | 01/01/70 00:00 | |
| New version | 01/01/70 00:00 | |
| Thanks Steve...and others | 01/01/70 00:00 | |
| NO | 01/01/70 00:00 | |
| I suggest you look at your own changes | 01/01/70 00:00 | |
| His new code | 01/01/70 00:00 | |
| very informative | 01/01/70 00:00 | |
| Another happy customer | 01/01/70 00:00 | |
| Young Double E? | 01/01/70 00:00 | |
| finished | 01/01/70 00:00 | |
the one at which end of the body? | 01/01/70 00:00 |



