Page 1 of 1

port monitoring

Posted: Wed Jan 28, 2009 8:03 pm
by moxy
Hi Guys, I am busy with my first flowcode project and need a bit of assistance. I am building a manual pulse generator for my cnc mill using a shaft encoder. I have got the pulse output sorted(reads 5 input pulses and outputs a measured pulse to port B pin 0) This gives me 200 pulses from a 1000 pulse/rev encoder. So far so good. What I need to know is how to monitor the input pin (port A pin0) for the incoming pulses and put the result into a register (eg. pulse) so I can apply it to the rest of the code. Hope I made sense!
Best regards
Les

Re: port monitoring

Posted: Thu Jan 29, 2009 1:11 pm
by Benj
Hi Les

Great news on the CNC let us know how your getting along. Had mine up and running about a year now :)

My frequency counter example may help if you need to count incoming pulses over a certain period of time.

http://www.matrixmultimedia.com/Flowcode_Examples.php

Re: port monitoring

Posted: Thu Jan 29, 2009 7:34 pm
by moxy
Hi Benj, many thanks for your quick reply, it should help somewhat. I don't need the freq count just the pulse count but I should be able to hack my way through it. The MPG that I'm building will be based on a stepper motor which will give me the detents that will match my 200 count code. (a bit of power on one of the phases will give a nice detent force control) Would I need to read the leading edge of the incoming pulses so that I don't increment my count reg many times with one longish pulse?
I have also had my mill running for a year or so and have just upgraded the X and Y stepper motors with some 1200 inch/ounce brutes that I got from Keling. They really make the rapids rapid! I have used the mill to make some PCB's which really worked out well. I have also just gotten a tiny airgrinder (58k rpm) which I will be fitting to the mill with an adapter, it should make the dental bits that I'm using a lot smoother cutting.
Many thanks
Les