SDLC capable PC/104 board

I am looking for a PC/104 board for synchoronus SDLC RS422
communication. It will receive data at 1.06Mbit/s, externally clocked.

I am concerned about system performance, so I think a board with large
enough FIFOS, say 128 bytes or larger, is needed. The data source will send
32 bytes packets at 400 times per second.

Any recommendations of boards? Drivers and/or QNX6 code examples
is required.

Connect Tech has a new board, ComSync104, but that board seems to be
DMA based instead of using deep buffers. I am concerned about the amount
of IRQ:s it will generate given the setup above.

Cheers / Tom

On Tue, 11 Jun 2002 12:25:44 +0200, Tomas =?iso-8859-1?Q?H=F6gstr=F6m?= <tomas@scandicraft.se> wrote:

I am looking for a PC/104 board for synchoronus SDLC RS422
communication. It will receive data at 1.06Mbit/s, externally clocked.

I am concerned about system performance, so I think a board with large
enough FIFOS, say 128 bytes or larger, is needed. The data source will send
32 bytes packets at 400 times per second.

Any recommendations of boards? Drivers and/or QNX6 code examples
is required.

Connect Tech has a new board, ComSync104, but that board seems to be
DMA based instead of using deep buffers. I am concerned about the amount
of IRQ:s it will generate given the setup above.

Agree it could be a problem. I think the
85230 has 3 byte FIFO, which
means you will need to clear the FIFO
no less than every ~24 microseconds.
Possibly you will have to do everything
in the ISR, and not use
DMA at all. Once you get the first interrupt,
stay in the
ISR until the message is received or a
timeout occurs.
AFAIK, with the PC/104 & synch combo, you don’t
have many choices…

Alex Cellarius wrote:

On Tue, 11 Jun 2002 12:25:44 +0200, Tomas =?iso-8859-1?Q?H=F6gstr=F6m?= <> tomas@scandicraft.se> > wrote:
I am looking for a PC/104 board for synchoronus SDLC RS422
communication. It will receive data at 1.06Mbit/s, externally clocked.

I am concerned about system performance, so I think a board with large
enough FIFOS, say 128 bytes or larger, is needed. The data source will send
32 bytes packets at 400 times per second.

Any recommendations of boards? Drivers and/or QNX6 code examples
is required.

Connect Tech has a new board, ComSync104, but that board seems to be
DMA based instead of using deep buffers. I am concerned about the amount
of IRQ:s it will generate given the setup above.

Agree it could be a problem. I think the 85230 has 3 byte FIFO, which
means you will need to clear the FIFO no less than every ~24 microseconds.
Possibly you will have to do everything in the ISR, and not use
DMA at all. Once you get the first interrupt, stay in the
ISR until the message is received or a timeout occurs.
AFAIK, with the PC/104 & synch combo, you don’t
have many choices…

Especially if QNX drivers is a requirement as is immediate delivery. But there are some alternatives:
Amp, UK, has an eight port sync/async board with 64+64bytes FIFOS, and QNX drivers (probably).
Looks nice, perhaps my strongest candidate currently. I would wish deeper FIFOs though.
Sealevel. DMA based, no QNX drivers.
Winsystems 4/8bytes FIFOS, DMA. no QNX (?).
Elzet80, 512bytes FIFOS! But this is Bitbus (compatibility?), and unfortunately cannot handle
external data clock. no QNX.
GSC has a cool board with PC/104 bus, but double PC/104 size (doesn’t fit for us),
but with up to 128kB FIFOS!
Connect Tech. I like their products and support, but perhaps they don’t have the right product
for this application. I’m investigating that.

Cheers / Tom

Tomas Högström <tomas@scandicraft.se> wrote in article <3D06FBA6.7AEB8BD1@scandicraft.se>…

Alex Cellarius wrote:

On Tue, 11 Jun 2002 12:25:44 +0200, Tomas =?iso-8859-1?Q?H=F6gstr=F6m?= <> tomas@scandicraft.se
wrote:
I am looking for a PC/104 board for synchoronus SDLC RS422
communication. It will receive data at 1.06Mbit/s, externally clocked.

I am concerned about system performance, so I think a board with large
enough FIFOS, say 128 bytes or larger, is needed. The data source will send
32 bytes packets at 400 times per second.

Any recommendations of boards? Drivers and/or QNX6 code examples
is required.

Connect Tech has a new board, ComSync104, but that board seems to be
DMA based instead of using deep buffers. I am concerned about the amount
of IRQ:s it will generate given the setup above.

Hi guys,
I’m sorry for my ignorance. Could you, please, explain me why DMA based solution doesn’t meet your
requirements? Does that board has no TC signal support? Or there is no T/C (transfer complete)
signal in PC/104 bus? What’s the problem to use 128 bytes or larger DMA buffer and switch buffers
in ISR?
Thanks.

Eduard.
ed1k at ukr dot net



Agree it could be a problem. I think the 85230 has 3 byte FIFO, which
means you will need to clear the FIFO no less than every ~24 microseconds.
Possibly you will have to do everything in the ISR, and not use
DMA at all. Once you get the first interrupt, stay in the
ISR until the message is received or a timeout occurs.
AFAIK, with the PC/104 & synch combo, you don’t
have many choices…

Especially if QNX drivers is a requirement as is immediate delivery. But there are some
alternatives:
Amp, UK, has an eight port sync/async board with 64+64bytes FIFOS, and QNX drivers (probably).
Looks nice, perhaps my strongest candidate currently. I would wish deeper FIFOs though.
Sealevel. DMA based, no QNX drivers.
Winsystems 4/8bytes FIFOS, DMA. no QNX (?).
Elzet80, 512bytes FIFOS! But this is Bitbus (compatibility?), and unfortunately cannot handle
external data clock. no QNX.
GSC has a cool board with PC/104 bus, but double PC/104 size (doesn’t fit for us),
but with up to 128kB FIFOS!
Connect Tech. I like their products and support, but perhaps they don’t have the right product
for this application. I’m investigating that.

Cheers / Tom

ed1k <ed1k@spamerstrap.com> wrote in article 01c211f2$35a72720$106fa8c0@ED1K

Or there is no T/C (transfer complete)
signal in PC/104 bus?

Right now I checked out the documentation on pc/104 bus. There is TC signal in the bus. The problem
is only in Connect Tech’s device. Does it support analizing the DACK&TC signals in order to set
IRQ? Otherwise, the DMA is not something very useful for this card. In worst case you might have to
poll DMA status register, and get data not every 3 * 8 /1.06 us, but DMA_BUFFER_SIZE * 8/1.06 us.
I used DMA without any FIFOs (just a register latch) in order to receive 83250 bytes/sec stream, it
was 386DX40 with ISA, but I used 16bit DMA transfers (max DMA buffer is 128K, for 8bit DMA
transfers max DMA buffer is 64K, much more then FIFO :slight_smile:) Also this stream was processed by that
board. In your case, you have 32bytes * 400 = 12800 bytes/sec. I don’t see why DMA is not your
case?

Cheers,

Eduard.
ed1k at ukr dot net

Thanks for your thoughts Eduard. I have no experience of DMA
programming, that’s the reason why I’m uncertain about the performance
of DMA solutions and it’s impact on the realtime performance of the system.
Perhaps DMA is not so bad after all.
Do you know of any good ISA DMA programming examples for QNX6?

Cheers / Tom

ed1k wrote:

Tomas Högström <> tomas@scandicraft.se> > wrote in article <> 3D06FBA6.7AEB8BD1@scandicraft.se> >…
Alex Cellarius wrote:

On Tue, 11 Jun 2002 12:25:44 +0200, Tomas =?iso-8859-1?Q?H=F6gstr=F6m?= <> tomas@scandicraft.se
wrote:
I am looking for a PC/104 board for synchoronus SDLC RS422
communication. It will receive data at 1.06Mbit/s, externally clocked.

I am concerned about system performance, so I think a board with large
enough FIFOS, say 128 bytes or larger, is needed. The data source will send
32 bytes packets at 400 times per second.

Any recommendations of boards? Drivers and/or QNX6 code examples
is required.

Connect Tech has a new board, ComSync104, but that board seems to be
DMA based instead of using deep buffers. I am concerned about the amount
of IRQ:s it will generate given the setup above.

Hi guys,
I’m sorry for my ignorance. Could you, please, explain me why DMA based solution doesn’t meet your
requirements? Does that board has no TC signal support? Or there is no T/C (transfer complete)
signal in PC/104 bus? What’s the problem to use 128 bytes or larger DMA buffer and switch buffers
in ISR?
Thanks.

Eduard.
ed1k at ukr dot net


Agree it could be a problem. I think the 85230 has 3 byte FIFO, which
means you will need to clear the FIFO no less than every ~24 microseconds.
Possibly you will have to do everything in the ISR, and not use
DMA at all. Once you get the first interrupt, stay in the
ISR until the message is received or a timeout occurs.
AFAIK, with the PC/104 & synch combo, you don’t
have many choices…

Especially if QNX drivers is a requirement as is immediate delivery. But there are some
alternatives:
Amp, UK, has an eight port sync/async board with 64+64bytes FIFOS, and QNX drivers (probably).
Looks nice, perhaps my strongest candidate currently. I would wish deeper FIFOs though.
Sealevel. DMA based, no QNX drivers.
Winsystems 4/8bytes FIFOS, DMA. no QNX (?).
Elzet80, 512bytes FIFOS! But this is Bitbus (compatibility?), and unfortunately cannot handle
external data clock. no QNX.
GSC has a cool board with PC/104 bus, but double PC/104 size (doesn’t fit for us),
but with up to 128kB FIFOS!
Connect Tech. I like their products and support, but perhaps they don’t have the right product
for this application. I’m investigating that.

Cheers / Tom

Tomas Högström <tomas@scandicraft.se> wrote in article <3D073144.FEA73A8A@scandicraft.se>…

Thanks for your thoughts Eduard. I have no experience of DMA
programming, that’s the reason why I’m uncertain about the performance
of DMA solutions and it’s impact on the realtime performance of the system.
Perhaps DMA is not so bad after all.
Do you know of any good ISA DMA programming examples for QNX6?

No. I worked in DOS with DMA :slight_smile: I think work with hardware is the same, but some QNX functions
make this work much easier.

Eduard.
ed1k at ukr dot net

Tomas H?gstr?m <tomas@scandicraft.se> wrote:

Thanks for your thoughts Eduard. I have no experience of DMA
programming, that’s the reason why I’m uncertain about the performance
of DMA solutions and it’s impact on the realtime performance of the system.
Perhaps DMA is not so bad after all.

Actually, DMA is often wanted because it imposes less system
overhead than other solutions. If you’re doing direct code
to move data in and out of your card, you’ve got your CPU waiting
on the (slow, slow, dog-slow) ISA bus. If you’re doing DMA, the
DMA controller will be waiting on the bus, but the CPU can be off
doing other things.

You won’t get your data in and out any faster – but you can be
doing something else while the data is copied accross the ISA
bus.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Tomas Högström <tomas@scandicraft.se> wrote in article <3D06FBA6.7AEB8BD1@scandicraft.se>…

Connect Tech. I like their products and support, but perhaps they don’t have the right product
for this application. I’m investigating that.

I looked at ComSync104.pdf file on their web-site. It only says “Support for four software
programmable DMA channels”, it’s not too much for deciding is this card good for you or not.
Contact ConnectTech for more information :wink:)
Without knowledge of ComSync’s hardware spec., I cannot tell anything about programming DMA with
this card. The card could use Single Transfer Mode or, for instance, Demand Transfer Mode in order
to write all contents of internal FIFO into memory. You need know of these details to program DMA
operation. There is a lot information about DMA programming in Internet, also there is Intel 8237A
spec. - it’s good document for understanding of DMA.

And, I hope, you don’t need reply every 32bytes packet before getting the next packet :wink:
Cheers.

Eduard.

On 12 Jun 2002 10:40:48 GMT, “ed1k” <ed1k@spamerstrap.com> wrote:

ed1k <> ed1k@spamerstrap.com> > wrote in article 01c211f2$35a72720$106fa8c0@ED1K
Or there is no T/C (transfer complete)
signal in PC/104 bus?

Right now I checked out the documentation on pc/104 bus. There is TC signal in the bus. The problem
is only in Connect Tech’s device. Does it support analizing the DACK&TC signals in order to set
IRQ? Otherwise, the DMA is not something very useful for this card. In worst case you might have to
poll DMA status register, and get data not every 3 * 8 /1.06 us, but DMA_BUFFER_SIZE * 8/1.06 us.
I used DMA without any FIFOs (just a register latch) in order to receive 83250 bytes/sec stream, it
was 386DX40 with ISA, but I used 16bit DMA transfers (max DMA buffer is 128K, for 8bit DMA
transfers max DMA buffer is 64K, much more then FIFO > :slight_smile:> ) Also this stream was processed by that
board. In your case, you have 32bytes * 400 = 12800 bytes/sec. I don’t see why DMA is not your
case?

Actually come to think of it, if the DMA is implemented properly
(and I’m sure ConnectTech would have), you should get 1 interrupt
at the start of a transfer. This will tell you there’s data coming.
Then you should be able to set up the DMA controller, and
DMA should be able to continue without further interrupts
until the end of the receive.

If you can find programming examples on using DOS & DMA, that knowledge
will be readily transferable to QNX…

But I would first speak to ConnectTech about their QNX6 driver..

Alex Cellarius wrote:

On 12 Jun 2002 10:40:48 GMT, “ed1k” <> ed1k@spamerstrap.com> > wrote:
ed1k <> ed1k@spamerstrap.com> > wrote in article 01c211f2$35a72720$106fa8c0@ED1K
Or there is no T/C (transfer complete)
signal in PC/104 bus?

Right now I checked out the documentation on pc/104 bus. There is TC signal in the bus. The problem
is only in Connect Tech’s device. Does it support analizing the DACK&TC signals in order to set
IRQ? Otherwise, the DMA is not something very useful for this card. In worst case you might have to
poll DMA status register, and get data not every 3 * 8 /1.06 us, but DMA_BUFFER_SIZE * 8/1.06 us.
I used DMA without any FIFOs (just a register latch) in order to receive 83250 bytes/sec stream, it
was 386DX40 with ISA, but I used 16bit DMA transfers (max DMA buffer is 128K, for 8bit DMA
transfers max DMA buffer is 64K, much more then FIFO > :slight_smile:> ) Also this stream was processed by that
board. In your case, you have 32bytes * 400 = 12800 bytes/sec. I don’t see why DMA is not your
case?

Actually come to think of it, if the DMA is implemented properly
(and I’m sure ConnectTech would have), you should get 1 interrupt
at the start of a transfer. This will tell you there’s data coming.
Then you should be able to set up the DMA controller, and
DMA should be able to continue without further interrupts
until the end of the receive.

If you can find programming examples on using DOS & DMA, that knowledge
will be readily transferable to QNX…

But I would first speak to ConnectTech about their QNX6 driver..

I have spoken with them. Unfortunately there’s no available QNX6 driver
at this time. The problem with DMA in this case is that the amount of data
to be transferred at each time is small, around 4 bytes (due to the FIFO size :sunglasses:.
For so small data chunks the overhead of using DMA makes it not much
better than using only a standard IRQ driven CPU collect. In my case it means
that the CPU will be essentially busy at each packets’s arrival, i.e. it will be spending
around 10% of it’s time either moving the data or rearming the DMA controller
depending on the choice of driver implementation.
For a ten times deeper FIFO I think the reduction of CPU load during the burst
would be almost a tenth (using DMA).
If the CPU locking at 400Hz is no problem, this board is of course ok.

Alex Cellarius <acellarius@yahoo.com> wrote in article 1105_1024000961@pentiumii

On 12 Jun 2002 10:40:48 GMT, “ed1k” <> ed1k@spamerstrap.com> > wrote:
ed1k <> ed1k@spamerstrap.com> > wrote in article 01c211f2$35a72720$106fa8c0@ED1K

Actually come to think of it, if the DMA is implemented properly
(and I’m sure ConnectTech would have), you should get 1 interrupt
at the start of a transfer.

Actually you should get interrupt at the end of transfer. When startup IPL (or BIOS) inits the
DMA controller ALL not used DMA channels are DISABLED. So, you have not to worry too much about DMA
request signal from board, DMA controller will just ignore it. TC, while active DACK signal is,
never happens, that is interrupt request never happens (additionly this IRQ disabled during startup
as a rule). When your program (directly dealt or some kind of resmgr) starts, it should program DMA
with proper mode, first buffer memory address etc. and after these steps it should enable DMA
channel. So, when first interrupt happens you will have the data in the buffer. Never program DMA
controller while DMA channel you deal which is enabled. During interrupt you have to:

  1. disable DMA operation on channel (or even disable DMA controller - it’s only one bit in config
    register)
  2. program DMA controller to operate with second buffer
  3. enable DMA operation on channel
  4. send event to waiting interrupt thread “Data complete in the first buffer” during leaving ISR.
    The thread blocked on InterruptWait() should process the data in the first buffer as fast as it’s
    required to collect data into second buffer. Then next interrupt should program DMA controller to
    operate with first buffer. You might want some additional buffers to grab data from DMA buffer as
    fast as possible, or some other mechanism of monkeying with buffers. I just give an idea how it
    works.

This will tell you there’s data coming.
Then you should be able to set up the DMA controller, and
DMA should be able to continue without further interrupts
until the end of the receive.

If you can find programming examples on using DOS & DMA, that knowledge
will be readily transferable to QNX…

It very depends on hardware. I’ll try to answer concrete questions :wink:

But I would first speak to ConnectTech about their QNX6 driver..

It’s good idea. I know ConnectTech have a good support :wink:


Eduard.
ed1k at ukr dot net

Tomas Högström <tomas@scandicraft.se> wrote in article <3D09ACD9.E4900D30@scandicraft.se>…

Alex Cellarius wrote:

On 12 Jun 2002 10:40:48 GMT, “ed1k” <> ed1k@spamerstrap.com> > wrote:
ed1k <> ed1k@spamerstrap.com> > wrote in article 01c211f2$35a72720$106fa8c0@ED1K
Or there is no T/C (transfer complete)
signal in PC/104 bus?

Right now I checked out the documentation on pc/104 bus. There is TC signal in the bus. The
problem
is only in Connect Tech’s device. Does it support analizing the DACK&TC signals in order to
set
IRQ? Otherwise, the DMA is not something very useful for this card. In worst case you might
have to
poll DMA status register, and get data not every 3 * 8 /1.06 us, but DMA_BUFFER_SIZE * 8/1.06
us.
I used DMA without any FIFOs (just a register latch) in order to receive 83250 bytes/sec
stream, it
was 386DX40 with ISA, but I used 16bit DMA transfers (max DMA buffer is 128K, for 8bit DMA
transfers max DMA buffer is 64K, much more then FIFO > :slight_smile:> ) Also this stream was processed by
that
board. In your case, you have 32bytes * 400 = 12800 bytes/sec. I don’t see why DMA is not
your
case?

Actually come to think of it, if the DMA is implemented properly
(and I’m sure ConnectTech would have), you should get 1 interrupt
at the start of a transfer. This will tell you there’s data coming.
Then you should be able to set up the DMA controller, and
DMA should be able to continue without further interrupts
until the end of the receive.

If you can find programming examples on using DOS & DMA, that knowledge
will be readily transferable to QNX…

But I would first speak to ConnectTech about their QNX6 driver..

I have spoken with them. Unfortunately there’s no available QNX6 driver
at this time. The problem with DMA in this case is that the amount of data
to be transferred at each time is small, around 4 bytes (due to the FIFO size > :sunglasses:> .

Tomas,
Actually it does not matter. Which DMA mode they intend to use. Is it single transfer mode? In this
case you really will have transfer of ONE byte per DMA cycle. But it doesn’t touch you. It’s
background hardware process without any intervension of CPU. During DMA cycle one byte written into
RAM, but you have nothing to do with this. DMA controller has DMA transfer counter, every time when
DMA cycle occurs it decreases. When this counter reach 0xffff (in other words - DMA controller
recievs the last byte in transfer, or it’s writting the last byte into memory buffer), the DMA
controller sets DACK (dma acknowledge) and TC (transfer complete or Terminal Count) signals. Does
the card use these signals to set interrupt request on line?
In this asumption you have 4*byterates time to reprogram DMA controller. During reprogramming, when
DMA is disabled, input bytes will just collect into FIFO and as soon as you enable DMA the card
sends these bytes to your new buffer.

I don’t believe Connect Tech’s hardware solution is worse than I describe above.

Cheers,

Eduard.
ed1k at ukr dot net



For so small data chunks the overhead of using DMA makes it not much
better than using only a standard IRQ driven CPU collect. In my case it means
that the CPU will be essentially busy at each packets’s arrival, i.e. it will be spending
around 10% of it’s time either moving the data or rearming the DMA controller
depending on the choice of driver implementation.
For a ten times deeper FIFO I think the reduction of CPU load during the burst
would be almost a tenth (using DMA).
If the CPU locking at 400Hz is no problem, this board is of course ok.

Tomas,
Actually it does not matter. Which DMA mode they intend to use. Is it single transfer mode? In this
case you really will have transfer of ONE byte per DMA cycle. But it doesn’t touch you. It’s
background hardware process without any intervension of CPU. During DMA cycle one byte written into
RAM, but you have nothing to do with this. DMA controller has DMA transfer counter, every time when
DMA cycle occurs it decreases. When this counter reach 0xffff (in other words - DMA controller
recievs the last byte in transfer, or it’s writting the last byte into memory buffer), the DMA
controller sets DACK (dma acknowledge) and TC (transfer complete or Terminal Count) signals. Does
the card use these signals to set interrupt request on line?
In this asumption you have 4*byterates time to reprogram DMA controller. During reprogramming, when
DMA is disabled, input bytes will just collect into FIFO and as soon as you enable DMA the card
sends these bytes to your new buffer.

Yes, but since the byterate is high this will use much of the CPU during the burst.
Using 1 or 4 byte transfers, each transfer will take 7.5 or 30 microseconds
and after each transfer the CPU will get an interrupt and have to reprogram the
DMA controller? Due to overhead there will probably not be so much time left between
the interrupt handlings during the 241 microsec bursts, will it?
400 such bursts per second → 100ms per second spent moving data or
reprogramming the DMA controller. This might be a problem or not depending on one’s
requirements.

Cheers / Tom

On Fri, 14 Jun 2002 10:44:09 +0200, Tomas =?iso-8859-1?Q?H=F6gstr=F6m?= <tomas@scandicraft.se> wrote:

I have spoken with them. Unfortunately there’s no available QNX6 driver
at this time. The problem with DMA in this case is that the amount of data
to be transferred at each time is small, around 4 bytes (due to the FIFO size > :sunglasses:> .
For so small data chunks the overhead of using DMA makes it not much
better than using only a standard IRQ driven CPU collect. In my case it means
that the CPU will be essentially busy at each packets’s arrival, i.e. it will be spending
around 10% of it’s time either moving the data or rearming the DMA controller
depending on the choice of driver implementation.
For a ten times deeper FIFO I think the reduction of CPU load during the burst
would be almost a tenth (using DMA).
If the CPU locking at 400Hz is no problem, this board is of course ok.

But without the interrupt, you don’t have the overhead of the
interrupt latency every few bytes. It’s purely moving data from the USART to
memory.

Alex Cellarius wrote:

On Fri, 14 Jun 2002 10:44:09 +0200, Tomas =?iso-8859-1?Q?H=F6gstr=F6m?= <> tomas@scandicraft.se> > wrote:
..
I have spoken with them. Unfortunately there’s no available QNX6 driver
at this time. The problem with DMA in this case is that the amount of data
to be transferred at each time is small, around 4 bytes (due to the FIFO size > :sunglasses:> .
For so small data chunks the overhead of using DMA makes it not much
better than using only a standard IRQ driven CPU collect. In my case it means
that the CPU will be essentially busy at each packets’s arrival, i.e. it will be spending
around 10% of it’s time either moving the data or rearming the DMA controller
depending on the choice of driver implementation.
For a ten times deeper FIFO I think the reduction of CPU load during the burst
would be almost a tenth (using DMA).
If the CPU locking at 400Hz is no problem, this board is of course ok.


But without the interrupt, you don’t have the overhead of the
interrupt latency every few bytes. It’s purely moving data from the USART to
memory.

But without interrupt I don’t know when to read any data from the USART, do I?
And busy waiting will use even more CPU time, won’t it? And using DMA requires a
DMA controller programming after each transfer (trigged by interrupt).

Tomas Högström <tomas@scandicraft.se> wrote in article <3D09C785.9BAB78F6@scandicraft.se>…

Tomas,
Actually it does not matter. Which DMA mode they intend to use. Is it single transfer mode? In
this
case you really will have transfer of ONE byte per DMA cycle. But it doesn’t touch you. It’s
background hardware process without any intervension of CPU. During DMA cycle one byte written
into
RAM, but you have nothing to do with this. DMA controller has DMA transfer counter, every time
when
DMA cycle occurs it decreases. When this counter reach 0xffff (in other words - DMA controller
recievs the last byte in transfer, or it’s writting the last byte into memory buffer), the DMA
controller sets DACK (dma acknowledge) and TC (transfer complete or Terminal Count) signals.
Does
the card use these signals to set interrupt request on line?
In this asumption you have 4*byterates time to reprogram DMA controller. During reprogramming,
when
DMA is disabled, input bytes will just collect into FIFO and as soon as you enable DMA the card
sends these bytes to your new buffer.

Yes, but since the byterate is high this will use much of the CPU during the burst.

Did I miss something? When card intends to pass byte to memory, it sends hardware signal DREQx (dma
channel x request). DMA controller gets this signal and sends signal HRQ (hold request) in order to
take bus in monopolic usage, CPU answers HLDA (hold acknowledge), then DMA controller answers DACKx
(dma chan x acknowledge) to the board. CPU’s buses are in hiZ state. I.E. CPU has nothing to do
with DMA, it just stops in ISA architecture. Yes, it takes a bit of time, in other words it takes
few ISA bus cycles to write byte from card to system memory. For example, for worse case it takes 8
ISA clks for byte transfer. It takes 8 / (33 MHz) = 0.24 uS. It can be faster and it depends on
your hardware (PCI-to-ISA bridge, etc.)

Using 1 or 4 byte transfers,

When you program DMA controller, you tell him the start address of your buffer and lenght of
buffer, i.e. how many bytes you want to write, before to wake up your card by TC signal in order to
get interrupt. lenght of DMA buffer in 1 or 4 bytes is nonsense. But card might be designed to send
4 or more bytes per an ISA bus hold. Anyway the TC signal will generated only when buffer is full.
Just in this case, CPU has ocassion to idle a bit more time while DMA controller writes bytes to
memory. What is diference for you will data in buffer grow up on 1 byte or 4? You have only
programm 8237 chip differently and perhaps to have buffer lenght divisible without remainder by 4
for second case.

each transfer will take 7.5 or 30 microseconds
and after each transfer the CPU will get an interrupt and have to reprogram the
DMA controller?

If you will program the DMA controller to write into memory 4 bytes lenght buffer then yes. But
main idea in DMA is to use longer buffer, says 48 K bytes and let hardware to fill out this buffer
without any your intervention. So, it’s designed to get interrupt every 7.5481024 uS, just an
example for your case.

I’d recommend you to take a look at your PC/104 user manual. Many manufacturers include the section
“DMA operation”. Or just look at Intel 8237A datasheet. Intel’s “Peripheral Components” book
describes this chip very well.

Eduard.
ed1k at ukr dot net


Due to overhead there will probably not be so much time left between
the interrupt handlings during the 241 microsec bursts, will it?
400 such bursts per second → 100ms per second spent moving data or
reprogramming the DMA controller. This might be a problem or not depending on one’s
requirements.

Cheers / Tom

Tomas Högström <tomas@scandicraft.se> wrote in article <3D09D99B.DB29A730@scandicraft.se>…

Alex Cellarius wrote:

On Fri, 14 Jun 2002 10:44:09 +0200, Tomas =?iso-8859-1?Q?H=F6gstr=F6m?= <> tomas@scandicraft.se
wrote:
..
I have spoken with them. Unfortunately there’s no available QNX6 driver
at this time. The problem with DMA in this case is that the amount of data
to be transferred at each time is small, around 4 bytes (due to the FIFO size > :sunglasses:> .
For so small data chunks the overhead of using DMA makes it not much
better than using only a standard IRQ driven CPU collect. In my case it means
that the CPU will be essentially busy at each packets’s arrival, i.e. it will be spending
around 10% of it’s time either moving the data or rearming the DMA controller
depending on the choice of driver implementation.
For a ten times deeper FIFO I think the reduction of CPU load during the burst
would be almost a tenth (using DMA).
If the CPU locking at 400Hz is no problem, this board is of course ok.


But without the interrupt, you don’t have the overhead of the
interrupt latency every few bytes. It’s purely moving data from the USART to
memory.

But without interrupt I don’t know when to read any data from the USART, do I?
And busy waiting will use even more CPU time, won’t it? And using DMA requires a
DMA controller programming after each transfer (trigged by interrupt).

I don’t think reprogramming DMA controller every 0.4-0.49 seconds is overhead.
But perhaps huge FIFO is much easy to understand :wink:

Eduard.
ed1k at ukr dot net

I don’t think reprogramming DMA controller every 0.4-0.49 seconds is overhead.
But perhaps huge FIFO is much easy to understand > :wink:

Eduard.
ed1k at ukr dot net

:slight_smile: Yes, I might have missed something here. If using fairly large
DMA chunks I realize now that the interrupt load will be small (i.e
proportional to the destination buffer length).

Cheers / Tom

ed1k <ed1k@spamerstrap.com> wrote:
(A couple of very useful posts on how DMA works.)

Thank you for your posts on DMA. I’ve found they have helped to
clarify my understanding of it.

-David


QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.