Stupid LVP![]()
Set all outputs to 1 and it's showing 5.1 or thereabouts on all of them.
Everything working fine now! thanks!![]()
Did I forget to mention that I'm using an AT computer psu? Is that a bad thing<sup>tm</sup>?
Stupid LVP![]()
Set all outputs to 1 and it's showing 5.1 or thereabouts on all of them.
Everything working fine now! thanks!![]()
Metal cans with two leads are crystal oscillators. You will also need to hook up two small capacitors (around 20pf) to get the crystal to resonate. The datasheet shows a small drawing of how to hook one up correctly. I usually use a 3 lead ceramic resonator since they have built in capacitors. Just a little bit easier to use.
I did a simple stepper controller using a 16f627 which is similiar to your 628. I used the external resister ER oscillator mode. Hooked up a 1K resister to OSC1 and ground gets the chip working around 10Mhz. I used the interrupt on change B4 and B5 for step input. At 10Mhz, it was plenty fast to control 2 stepper motors. I did have to set the pulse width output of TurboCNC to about 20us. This gave the chip enough time to service the interrupt, poll the direction pins and output next step sequence.
The 12volt AT supply will limit your overall top end speed for your steppers which should be around 300RPM or so depending on the quality of your motors. 300RPM is about 2000steps/sec for half step mode. With careful coding, the internal 4Mhz oscillator speed should be able to handle atleast 300RPM using polled port A inputs. Just set Mach2 pulse width setting high enough so you don't miss the next step pulse.
Jim
My driver is my own design using the 16F628 as well (with LMD18245). I've used PORTB for input because I needed the 'Interrupt on Port Change'. With internal OSC, I'm able to handle about 30kHz step signal. No issue with pulse width because it's 'bit-change' driven.
Stupid questions make me smarter...
See how smart I've become at www.9w2bsr.com ;-P
abasir would you mind explaining the "decoupling capacitor near each pic" bit to me? where exactly do I put it? and what would be the purpose of it? also which diode should I use between e and c of transistors?![]()
Put 100nF capacitor between VCC and GND as close as possible to the PIC supply pins. Switching high current (your TIP...) will cause voltage spikes on the supply lines so the decoupling caps should take care of it. As for the diode, you need to pick based on the current and switching frequencies (both is unknown to me)
Stupid questions make me smarter...
See how smart I've become at www.9w2bsr.com ;-P
URGENT!
Problems with a PIC
All of a sudden, everything having worked ok so far, my PIC is just sitting there doing nothing. Now, when I say nothing I mean, it sort of initialises itself (I can see voltage on some pins) and that's it. I am using a 20MHz crystal and two 27pF caps (on my other board I'm using 20pF but the spec sheet says between 15 and 30pF so I guess I'm ok with 27)
So it's sitting there doing nothing. I put it into another board and it's working. In this, new, board it's just sitting there even if I reprogram it with the internal resonator at 4MHz. Any ideas? I don't seem to have any shorts on this board. What would make it halt? Anything particular I should look out for?
Thanks!
Check voltages on VCC/GND & MCLR. Either a short or a break somewhere![]()
Stupid questions make me smarter...
See how smart I've become at www.9w2bsr.com ;-P
maybe disconnect your driver board and place leds on the controller output pins untill everything looks like it is working fine.
then reconnect, OR lift the base limiting resistors ( one side ) from your drive board ( i think i saw leds on the driver board)
ps: maybe remove the leds from the pic pins when you you are ready to go and put then on the transistor outputs, as they will un necessarily load down the pic's o/p's
thanks for yor replies chaps. sambaraga I forgot to mention that I'm having trouble with my new incarnation of linistepper rather than my own driver.
abasir - I'll do that but I'm quite sure that's the first thing I checked. would that be the only reason why the pic would sit there doing nothing?
I forgot to mention that I'm getting around 6 volts from the PSU. It should be 5, I don't know, beats me.
Everything checks out. VCC/MCLR are connected. GND is connected too. A small peculiarity, when I switch it on and measure resistance between VDD and GND it's around 0.5 ohm and when I switch it off and measure it's 0. I hope that's ok?Originally Posted by abasir
So any other reasons why the processor would sit there doing nothing? I checked step and dir and they are all getting to RAs, no problem there. It can't be software or defective pic since I plug it into another board and it works there just fine. Untill someone responds I'll switch them on side-by-side and measure all voltages and resistances and see what's different.