Here is an example where you wouldn't want to use picbasic. at least I wouldn't.
1) I am currently controlling DC 2 motors via an H-Bridge, each motor requires 3 outputs from the pic, Enable and two direction (both directions are needed for quick stop) I have to output two PWM's each are dynamic in pulse-width, depending on a speed selection for each motor, and an encoder feedback to ensure they go at the required speed, or to compare the two motors to ensure they rotate the same amount. The encoders are each pulsing up to an average of 2 KHz. The PWM pulses are output at a frequency of approx 4Khz. Every 200 pulses I recieve from the encoders (100 ms), I update the PWM. I get the commands (speed/direction for each motor) from another PIC via a 4bit bus that is also read every 100ms, I also output a status pulse when a task is complete.
now maybe you could do this with basic, but I wasn't even going to try, I wrote this in ASM, but hey if I am wrong plesae correct me.
Bookmarks