The Shop > Electronics & IC Programing |
EasyPIC-6 Development Board by MikroElectronica - Take"2" |
<< < (8/14) > >> |
j45on:
--- Quote from: Bluechip on November 13, 2010, 04:16:47 PM ---WTF is it doing NOW??? --- End quote --- strangley I have said that a lot tonight as well :lol: This is about the most constructive thing I have managed to do |
Bluechip:
Jason Which PIC is it ?? Assume it is a PIC .. Dave BC |
kwackers:
If you want to be really clever, connect your stepper drivers 'clock' input to b1 of portC. Your stepper motor will now step 1 step each second. By changing the value in the delay you can change how fast it steps (reducing it will make it step faster). Then by using a counter to only do it so many times you've essentially got a simple divider! e.g. --- Code: ---void main() { int count; // variable we'll use to count TRISC = 0x00; // set direction to be output for (count = 0; count < 400; count++) // step 400 times { PORTC.b1 = 1; // Turn ON clock pulse PORTC.b1 = 0; // Turn OFF clock pulse Delay_ms(10); // 10 mS delay (about 100hz) } } --- End code --- Notice there isn't a delay between turning on the clock pulse and turning it off - this is because it only needs to be high for a tiny amount of time in order to be recognised by the driver. |
j45on:
It is the pic that came with the easypic 6 KIT PIC16F887-I/P |
Bluechip:
Ah! got 2 of them ... Just looked at the data sheet for PortC, P58 is interesting. All sorts of magic stuff on RC0, RC2. You might check the bits set in the registers on that table. Any one ending in xxxxxCON could be be incompatible with what you're doing. It may be configged for Osc out, Comparator out or PWM. Just a thought ... could well be nowt relevant in there. Dave BC |
Navigation |
Message Index |
Next page |
Previous page |