News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

need help for handling IRQ7

Started by digelo, July 01, 2012, 07:12:19 PM

Previous topic - Next topic

dedndave

Quote from: digelo on July 03, 2012, 04:37:33 PM...In Dos my father reached 180khz with parallel port for NMR interface manufactures. but thats a dream for me in Windows user-mode.
In Windows user-mode maximum speed i could communicate with my hardware was 1khz via serial port, beyond this speed can happen only in Windows kernel-mode...

your Dad's machine is probably not as fast as todays machines   :P
i managed to write some interrupt-driven serial port code that could handle 9600 baud nicely
that was on a 4.77 mHz 8088 - lol

parallel ports are much faster and easier to write code for, assuming you can install an interrupt handler

Siekmanski

What about FTDIChips ?
I use the FT232RL often to communicate with microcontrollers.
You can bitbang in high speed.
Data transfer rates from 300 baud to 3 Mbaud (RS422, RS485, RS232 ) at TTL levels.

http://www.ftdichip.com/Products/ICs/FT232R.htm

Or send an analog signal to the soundcard and detect the signal with the Goertzel algorithm.
Creative coders use backward thinking techniques as a strategy.

hutch--

There is another approach if speed matters, instead of messing around with stuff as ancient as com and parallel ports, look for a DLL that talks to USB 1/2/3 and shift from kilobytes to megabytes.  :bgrin:

digelo

Quote from: Siekmanski on July 04, 2012, 11:59:15 AM
What about FTDIChips ?
I use the FT232RL often to communicate with microcontrollers.
You can bitbang in high speed.
Data transfer rates from 300 baud to 3 Mbaud (RS422, RS485, RS232 ) at TTL levels.

http://www.ftdichip.com/Products/ICs/FT232R.htm

Or send an analog signal to the soundcard and detect the signal with the Goertzel algorithm.
I use FTDIChips for communicating via USB port (FT245), that's a good solution when u don wanna mess with USB protocols in ur microprocessor, but its speed is not fast enough.
Thanx for soundcard idea that's creative but not a good way for my project .

Quote from: hutch-- on July 04, 2012, 02:14:03 PM
There is another approach if speed matters, instead of messing around with stuff as ancient as com and parallel ports, look for a DLL that talks to USB 1/2/3 and shift from kilobytes to megabytes.  :bgrin:
USB port talks DLL is only for my PC side and its a bit hard to make USB protocols for my microprocessor too(FT245 do it for micros but i couldn't reach high speed with that) i chooses holy parallel port cuz of its simple way of communication and its IRQ7, in next step im ganna switch to PCI port but there i need to know how to write a Device Driver.

hutch--

The problem is you keep making assumptions about the PC side, if you want to run MS-DOS or a similar real mode operating system then you can play with IRQs, interrrupts and the like but if you want to run any modern version of Windows you either write a device driver or you use the Windows API functions.

digelo

Quote from: hutch-- on July 05, 2012, 12:21:19 AM
The problem is you keep making assumptions about the PC side, if you want to run MS-DOS or a similar real mode operating system then you can play with IRQs, interrrupts and the like but if you want to run any modern version of Windows you either write a device driver or you use the Windows API functions.
Why u think those are my assumptions? i explained why those ways is not suitable for me .
Im newbie in writing device driver, made this post to access others experiences .

Siekmanski

#21
3 Mbaud not fast enough for 50 KHz ?   :icon_confused:

I have translated the FTDI Api to Masm assembly and bitbanging is really fast.
Even with the RS232 protocol and a Baudrate of 921600 ( 8 databits and 1 stopbit ) you can send 102400 bits a second.
Or just toggle RTS or DTS or CTS and detect it on the PC.

If you need the sources let me know.
Creative coders use backward thinking techniques as a strategy.

digelo

ah i couldn't reach that speed , i think i really need those codes :D
are they work with FT245 too?:D

Siekmanski

Yes, you can communicate to all those FTDI chips. It's the complete FTDI Api.
I'll post it tomorrow.
Have to remove all the Dutch and translate it to English.

I recomment to use the bitbang method. ( 8 pins at once )
Creative coders use backward thinking techniques as a strategy.

Siekmanski

Just to get you in the mood:  :biggrin:

From  the docs : FT232 /FT245 BIT BANG MODE

The commands of interest are :
1) FT_SetBaudRate(ftHandle : Dword ; BaudRate : Dword) : FT_Result;
This controls the rate of transferring bytes that have been written to the device onto the pins. It also sets the sampling of the pins
and transferring the result back to the Read path of the chip. The maximum baud rate is 3 MegaBaud. The clock for the Bit Bang
mode is actually 16 times the baudrate. A value of 9600 baud would transfer the data at (9600 x 16) = 153600 bytes per second or
1 every 6.5 uS.
Creative coders use backward thinking techniques as a strategy.

Siekmanski

Masm sources for direct communication to FTDI devices.

I was experimenting with a Philips Tuner (FM1216ME/I H-3) ripped of, of an old pci TV-/Radio card.
This module has an MPX output in FM radio mode.
I needed control via the PC to monitor the MPX output from my FM transmitters.
So I used an ATmega168 microcontroller and a FTDI FT232RL chip to control the Tuner.

This is why I did the FTDI-Api translation to Masm ( my favorite language )

Be sure you have installed the Direct (D2XX) drivers and not use the Virtual COM Port (VCP) drivers.
The D2XX driver allows direct access to a USB device via a DLL interface.

link to FTDI home page:                     http://www.ftdichip.com/index.html
link to programmers guide:                http://www.ftdichip.com/Support/Documents/ProgramGuides.htm
link to D2XX_Programmer's_Guide:    http://www.ftdichip.com/Support/Documents/ProgramGuides/D2XX_Programmer's_Guide(FT_000071).pdf
link to application notes:                    http://www.ftdichip.com/Support/Documents/AppNotes.htm
link to BitBangMode FT232R-FT245R: http://www.ftdichip.com/Support/Documents/AppNotes/AN_232R-01_Bit_Bang_Mode_Available_For_FT232R_and_Ft245R.pdf
link to ChipID FT232R-FT245R:           http://www.ftdichip.com/Support/Documents/AppNotes/AN232R-02_FT232RChipID.pdf
Creative coders use backward thinking techniques as a strategy.

digelo