![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| HEY, Id like to use pic to control a stepper motor. The input commands of the PIC should come through the RS-232 serial port. Ive seen the attached schematic online but I can't see where is the RS-232 input to the pic micro-controller... Can u help me plz? and if anyone has any relevant schematic diagram? your help is deeply appreciated Thanks | |
| |
| | (permalink) |
| Hi, The schematic you posted does not show a PIC microcontroller... Do you have a particular PIC in mind? Regards, Mike | |
| |
| | (permalink) |
| HEY, THERE IS... THE PIC12C509 .... I'm intending to use the PIC16F628 OR PIC16F84 incase the 16f628 didn't arrive on time. I don't need a complicated functionality. All I need is to control the stepper from the computer using a microcontroller interface so I searched the internet and thought that the implementation of 12C509 would be similar... isn't it? thanks for the reply... | |
| |
| | (permalink) |
| Please forgive me... I missed that... It seems pin 4 is being used to receive RS232 data... I've done this on 8 pin 12F675 and 12F683 devices utilizing bit-banged serial code but I used 2N7000 (BS170) N-channel MOSFETs for the interface... Regards, Mike Last edited by Mike, K8LH; 6th May 2006 at 03:39 PM. | |
| |
| | (permalink) |
| I'd hold out for the 628 as that has an async port, bitbang serial I/O is a bit of a pain, especially to debug. You'd only need the RX side of mike's circuits, by the way since your diagram did not show TX in use. | |
| |
| | (permalink) |
| Does the original design look ok for you guys? It appears to be less compicated.... I can implement it on PIC16F628 or PIC16F84, TRUE? THANKS AGAIN GUYS..... | |
| |
| | (permalink) |
| I've seen 22K resistors used in PIC rs232 ports for years. Here's the old parallax app notes including code & schematics.
__________________ Bill Home of the Firefly PIC Tutor Inchworm ICD2 http://www.blueroomelectronics.com | |
| |
| | (permalink) | |
| Quote:
HOWEVER! - it's still worth using the 16F628 and USART, as it means you don't waste processor cycles bit-banging the serial routines. I've never got around to completing my stepper PIC tutorial yet (so much to do and so little time!), but essentially I used timer interrupts to do the stepping (with tables for the step patterns), and using a switch on an I/O pin to select half or full step modes. I did implement a bit-banged serial port though, and controlled it through that - although, as I said previously, using the USART in the 628 would be advantageous (my code was based on some old 16C84 code I wrote years ago - before the 628, or even the F84). You should be aware though that the USART requires inverted data, so you need to use a MAX232, or similar interface, that inverts the data. | ||
| |
| | (permalink) |
| OK.... THANK U ALL GUYS.... Ive found the PIC application notes really helpful so 2sum up I can use the attached diagram with the PIC outputs being connected to the ULN 2803 instead of being connected to the LEDS? YES OR NO? THANKS AGAIN FOR YOU ALL... U R BY BY FAR THE BEST HELPING FORUM ONLINE | |
| |
| | (permalink) | |
| Quote:
Check my tutorials for far more modern diagrams. | ||
| |
| | (permalink) |
| Yep, you can put a ULN2803 in place of the diodes. You shoud hook up pin 10 of the ULC2803 (the diode clamp) to the positive of your stepper motor power.
__________________ Bill Home of the Firefly PIC Tutor Inchworm ICD2 http://www.blueroomelectronics.com | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) | |
| Quote:
T'was a fun learning experience for me but it does require some time and effort... Not to worry... Should you ever find yourself in a position where a little 8-pin 12F675 or 12F683 would fit the bill and you need reliable bit-banged half-duplex or full-duplex serial I/O, with 16 byte circular Rx and Tx buffers no less, please don't hesitate to ask... You can also do half-duplex I/O using a single pin... Kind regards, Mike | ||
| |