News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Encoder...

Started by nevraxSMD, March 13, 2014, 04:48:25 AM

Previous topic - Next topic

anunitu

Blink blink blink....damn Dave you are the hardware MAN!!

dedndave

that's what i do   :biggrin:

asm code is for fun, mostly

Farabi

Hi, you will ned to use "IN" and "Out" instruction but you will need another dll to do that which I forget the name is. Basically the dll had a function with parameter, nPortNumber as dword and data you want to send as dword, but the data it really sent is a byte data. On my OS toys, I can use "IN" and "OUT" instruction freely since my OS is the kernel, but for windows you will need a 3rd party library to do that. I think that dll is freely available somewhere, its been years since last time I used it.
http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165

dedndave

#18
i was thinking he might be able to open the port with CreateFile, like you do with a serial port
maybe not   :P

i made a miscalculation, earlier
1000 RPM is 60000 RPS

using the 3-tooth wheel will get you a maximum frequency of 720 KHz
using the 5-tooth wheel will get you a maximum frequency of 1.2 MHz
1.2 MHz may be a little tough for B-series CMOS running at 5 VDC - i'll have to check the specs

in any event, you don't have to count all those bits
decide what resolution you want - and select a gate rate that will accommodate it
if 1000.0 RPM is enough resolution, that will still fit into a word,
but you'll have to use one of the control lines to read direction



TWell

How well IEEE-1284 parallel port works (USB to IEEE-1284)?
I have one with PL2305 IC chip info here

dedndave

i guess it works well
most modern PC's have EPP/ECP ports
on my machine, it is configured in BIOS setup

i don't think the original centronix interface has been used much since PS/2 (windows 3.1)
i have used the parallel port as bi-directional since days of windows 95


dedndave

i can help with the counter design, but i need to know more about what you want to do
if you want RPM, totalizer, resolution, etc
need details to do much   :P

TWell

And WinIO from here for direct access.

I'm interest USB to IEEE-1284 only, as there's no LPT's in laptops.

dedndave

oh - i like that driver - thanks, Timppa   :t

ieee-1284 is a parallel port...

http://en.wikipedia.org/wiki/IEEE_1284

my understanding is that you can emulate a parallel interface over USB,
but it's not a completely compatible emulation

actually - it would probably be better to design around a USB interface, to start with
i have written some code that uses a serial-mode USB port
it's reasonably simple and works on all newer OS's without special drivers
that also gives you the wireless option

TWell

I like to use usbprint.sys, as here without any external driver.
Just using USB001 port/handle.

Maybe it's time to open own thread for this topic ?

dedndave

here is a very nice description of the hardware interface for SPP, EPP, and ECP modes

http://www.ni.com/white-paper/3466/en/

near the top of the page, availabe as a PDF

nevraxSMD

i like the counter idea, unfortunatly i had class all day and didn't have the time to do any research on how it works.
the thing is i have to get a prety accuarate read of the rpm's and get it at a decent rate.
but i'm still cluless on how i can read the data in an actual asm program.
i need the rpm value to use it in a PID controller, so i can maintain the motor speed constant.


dedndave

i am happy to help
but, i need some numbers to work with - lol
Quotepretty accurate read of the rpm's and get it at a decent rate
doesn't give me much to go on   :P

dedndave

of course, you realize - it could be done in closed-loop - no computer at all   :P