port monitoring

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Post Reply
moxy
Posts: 14
Joined: Thu Nov 20, 2008 4:42 pm
Contact:

port monitoring

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: port monitoring

Post 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

moxy
Posts: 14
Joined: Thu Nov 20, 2008 4:42 pm
Contact:

Re: port monitoring

Post 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

Post Reply