| ??? 01/15/02 14:23 Read: times |
#18691 - RE: SFR ?? Bill Au |
Hi Billy
Say, since you already have 8051 ICs at ur disposal and it is to be used as a dedicated motor drive... you might as well use the timers and SFRs :) to implement your own PWM routine. In fact u have 2 timers and 32 I/O lines (assuming its a flash programmable 89cxx). You can use one timer to generate the PWM signal and the other to measure the feedback signal. Its very easy to change the duty cycle , once u have fixed the frequency. Say the freq is F, so the Time period is T = 1/F SO let this T = Ton + Toff Once u have Ton and Toff, all u gotta do to change the duty cycle is to increase one and decrease the other by equal amounts... i.e. to inc Duty Cycle, Ton = Ton + Delta Toff = Toff - Delta Thing is to keep the total of Ton and Toff constant.And there you have your PWM drive Since it will be interrupt-based, it can be a real-time thing. it can be a nice, challenging, do-able project I think. But of course that maybe coz I prefer to make FULL use of all available resources rather than go for ready-made solutions :D kundi |



