| ??? 04/26/04 03:50 Read: times |
#69182 - RE: PWM codes.......AT89C52 Responding to: ???'s previous message |
Why do you do this? ORL TH0,#0DCh ;reload timer 0 for 10 ms why not MOV TH0,#0DCh ;net result is the same but doing a MOV is more obvious as to what you want to do. Also the method of generating pwm by a rotating 16 bit register is interesting. What happens when you load a new value into PWM1? There is no way of synchronising the change therefore you will get a glitch. Not good practise. A simple way for doing a 8 bit pwm is to have a variable that increments each time tick. Then you compare the width variable with the time tick variable and set/reset the output bit depending on the result. For synchronisation you can update the width variable when the time tick count = 0. There are other methods you can try - do a search. Note that your method only gives a pwm granularity of 1 in 16. |
| Topic | Author | Date |
| T2MOD......AT89C52 | 01/01/70 00:00 | |
| RE: T2MOD......AT89C52 | 01/01/70 00:00 | |
| RE: T2MOD......AT89C52 | 01/01/70 00:00 | |
| RE: T2MOD......AT89C52 | 01/01/70 00:00 | |
| RE: T2MOD......AT89C52 | 01/01/70 00:00 | |
| RE: T2MOD......AT89C52 | 01/01/70 00:00 | |
| RE: T2MOD......AT89C52 | 01/01/70 00:00 | |
| RE: T2MOD......AT89C52 | 01/01/70 00:00 | |
| identify the coils?? | 01/01/70 00:00 | |
| identify the coils?? | 01/01/70 00:00 | |
RE: Stepper Motors | 01/01/70 00:00 | |
| PWM codes.......AT89C52 | 01/01/70 00:00 | |
| RE: PWM codes.......AT89C52 | 01/01/70 00:00 | |
| more explination plz | 01/01/70 00:00 | |
| RE: more explination plz | 01/01/70 00:00 | |
| RE: more explination plz | 01/01/70 00:00 | |
| RE: more explination plz | 01/01/70 00:00 | |
| concept | 01/01/70 00:00 | |
| RE: concept | 01/01/70 00:00 |



