??? 08/25/05 05:20 Read: times |
#100043 - Laser projecter / 8051 timer/PWM |
Hello all. Originally, I constructed an 8051 system for a robot I was going to build but never did. I posted here about it a few yrs back.
I received 2 stepper motors with balanced mirrors on them designed for high speed operation and built them into a projector system with a 10mW laser module. Each of these motors has 2 coils. Powering one coil makes the motor swing one direction, reverse direction for the other coil. I have been using software to create PWM output on io pins to drive the motors and its worked well for shapes and random patterns. Now, I wish to be able to draw Vector based patterns and images and herein lies the problem : Its easy to position one mirror half way between polls with software, but I have no idea how it would work for 2 mirrors. I believe I need to be able to generate a PWM output on an IO pin using the internal timer. If, for example I wanted to draw a straight line in the middle of the screen, I would need to apply a 50/50 pwm duty cycle to the vertical control to hold the mirror half-way up and down, while zooming the horizontal control mirror left and right. As far as I know, there is no way to generate a PWM signal with software on two different IO pins at one time. My problem is two fold : 1. I don't know how to generate this type of PWM signal on IO pins and I'm not even sure it can be done. I've looked at the FAQs but still I am lost. Is it possible to use the timer to generate this type of signal on one IO pin while the code continues to run the rest of the program? 2. Assuming I can even generate this type of signal and control the motors properly; I would like to use a program that generates data on a computer in vector format and then transfer that in realtime to the serial port for the 8051 to decode. Any thoughts on this? A lookup table, perhaps, for PWM speeds? I'm using a dallas c420 8051 running at 11mhz. This is what it can do, help me to make it even cooler : http://www.geocities.com/adempha/1.jpg http://www.geocities.com/adempha/2.jpg http://www.geocities.com/adempha/3.jpg |
Topic | Author | Date |
Laser projecter / 8051 timer/PWM | 01/01/70 00:00 | |
Doubtful | 01/01/70 00:00 | |
if speed is an issue | 01/01/70 00:00 | |
DAC | 01/01/70 00:00 | |
To reduce the data amount to transfer | 01/01/70 00:00 | |
table | 01/01/70 00:00 | |
No free lunch! | 01/01/70 00:00 | |
understandable | 01/01/70 00:00 | |
table and another approach... | 01/01/70 00:00 | |
VC program finished | 01/01/70 00:00 | |
Interrupt-driven Serial IO | 01/01/70 00:00 | |
stuck in a rut as so amny before you, wh | 01/01/70 00:00 | |
F120 overkill | 01/01/70 00:00 | |
that may be, but the proposed 12 clocker![]() | 01/01/70 00:00 |