L297 L298 Stepper Motor Driver For Mac
Hi, I'm still green if it's about electronics and I have the following question: how to control a L297 stepper motor control IC via a PIC18F2450 chip. I've attached an image of part of my circuit to this post. The plan is to sent commands from my PC via USB to the PIC18F2450 which will tell the L297 how to drive the motor. Basicaly i need to know how to connect the PIC18F2450 to the L297. Please be gentle.:D PS. Do I understand correctly the bit where I connect HOME to a push switch so when it's pressed the IC knows its home position?
L297 L298 Stepper Motor Driver For Mac Pro
Hi, Just had chance to look at the L297 - the Home function is actually an Output from the chip to say it is at its reset position, not the position of the motor. So using the circuit you have will actually short it out when the button is pressed. Think if you are wanting a motor home position then its a case of adding a suitable physical sensor like an opto interupter or hall sensor etc.
Some motors do have sensors built in. Think these two links will give you a bit more practical info. Just on the point of USB, that is a major project for anyone and requires C but you may find some ready to use code on Robotics or CNC forums. If you are using assembler or want something a bit simpler, use the Usart Rs232 function of the Pic connected to the PCs USB connector via one of the cheap RS232 to USB cable converters.
Get the impression you are thinking that the Pic is like a PC where you can Plug and Play. The Pics are different, they have hardware features like USB on the 18Fs, but you need to provide the controlling software. USB is one of the more complex Pic functions, for which C programming is a prerequisite. Microchip even produce a demo kit for this very purpose Also see this current and other posts on PIC / USB Don't know your reasons for doing this project - if its just for learning Pics and motor control then continuing with that but just doing pic to l297/8 control for now while you learn and add PC connectivety later via rs232, as mentioned ealier. If you are more into modelling and want pc control etc then think the Robotics forums will help you out better with slighly different programming solutions.
Thanks for the posts, today I was talking to Test Development @ work when I noticed a tiny PCB with a PIC18F6(.something) which as it turned out is directly connected to the USB connector (D+/D-) and has the possibility to update firmware with no need for any additional IC's like RS232.:) I will get the circuit diagrams tomorrow and see what makes it tick;) Also I did manage to get my claws on a development board for stepper motors which has a PIC16 on it and communicates with my PC with no problems (and no additional IC’s, except motor controllers). So what’s the big deal about USB connectivity?, everyone keeps telling me to do something simple for a starter but it seems it’s not a great deal to get it going. Sorry just read you post again:D (the part where you say it's mainly a firmware issue) which is not so bad as you can get samples from the net to get it going. Hi, If you have found a little development board that does motor control from the PC then great - sounds just the thing for you to really start learning with. You don't say if you are programming in C, Basic or Assembler etc? As for USB, well perhaps I have not been able to explain it clearly, partly because I have not been able to try it becuase of my lack of knowledge of the program language C18. To take one of the several Pic18F chips that have the USB hardware, you need a mass of complex C18 programming to establish a link with the PC, and only then can you start to program your code to send and receive data into your main program.
Don't think anyone would care to disagree that doing your own USB is for an experienced C programmer only. I don't want to discourage you from learning all about PIcs in any way, its a great interest and learing curve but think USB is a step too far for now. Attached is a picture of a little board I made to teach myself about motors - its just driven from my 18F pic dev board controlled by switches and an lcd. Bought the motors in a sale from a local model shop for just a few pounds/ dollars and they are driven by the L298 from the 18F. Since about 2 years I’m into C Sharp programming so I guess the best option would be to learn how to program in C or C. I trying to find a compiler for C sharp what would actually make programming the PIC fun!:D but I'm not sure there is one. I'm still in the process of understanding how the whole circuit (about 7 parts, woo-hoo!) interacts witch one another and how it will interact with my PC.
Something I have trouble with to understand is what is/isn't important while looking for a microcontroller, when I look at a datasheet that has 450 pages how to quickly determine if that’s the right IC for me? Or am I suppose to study it for 3-4 months and then say. Nah, that’s not what I need:D Now a naive but very important question: is there a different (easier) way to connect the board to the PC, without hardcore C programming (I guess that’s where the RS232 comes into play)? By the way - nice board you got there! Thanks & sorry for being a pain in the ass. RS232 is the other standard way to connect to a pc - it can be easily done with C or Assembler.
As for C and USB - on the Pic 18F chips its Microchip who supply much of the usb code in C18 - so you really have to follow their lead. Microchips IDE and C18 complier are both free downloads. I do not really know anything much about any version of C, so how similar C Sharp is I couldn't say. Perhaps a new post on this point will bring some fresh help.
A lot of folk, including those who started with C, agree that starting with Pic Assember is a good way to do things as it gives you a better understanding of the chip structutre. Agree that everything comes with big manual and datasheets, which should really be used a reference manuals.
Much better to look for the many tutorials that are around, starting with the infamous flashing led. A good and well supported one is.