parallel inputs

Questions on other types of hardware and getting it talking to the ARM CPU
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

parallel inputs

Post by YahooArchive »

>from the help line
>We have an Armite and am wondering how fast it is possible to read 14 bits of
data (in parallel) through the I/O ports either in Basic or if necessary in C
for a low-cost medical application. We would like to go at least 90kHz or faster
if possible. Also can this be done by just polling a status (ready) bit or would
an IRQ routine be necessary?

You can read the FIO0PIN register to read 32 bits in parallel on the ARMmite in
either BASIC or C. Details on that and other registers in the NXP user manual.

The logicscope demo actually reads the bits in parallel and then sorts out pin
vs bit later during the display. The rate on the ARMmite is around 1
MSample/sec. So you can easily do 90 KHz using the TIMER for sample spacing.

On the PROplus and SuperPRO, the sample rate exceeds 4 Msamples/sec.



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: parallel inputs

Post by YahooArchive »

>from the help line
>Is there a way to do a byte write to a byte of I/O? All I see are bit
operations.

In both BASIC and C you can read/write directly to the port registers. This
will give you access to 32 bits at a time.

x = FIO0PIN

will read the IO pins.

Normally I user SET and CLR registers to control pins, but that takes multiple
operations. You can also write directly to the PIN register with MASK
controlling which pins are affected. Details on this in the NXP User manual.

>will the command sequence HIGH(0), LOW(0), ... produce a squarewave at half the
processor frequency on I/O 0? The data sheet states >4 million I/O operations
per second, one would think that it should be the same as the processor clock
assuming one cycle operations. >Perhaps HIGH/LOW are not one cycle operations. I
need a way to output I/O at the processor clock frequency.

HIGH/LOW are not one cycle operations, you would have to load a register with
the pointer and access the pins that way. Even then you probably won't be able
to toggle pins at 50 MHz.

To get to that frequency you should use the PWM or motor PWM in the SuperPRO.
With that by increasing PCLK rates and setting the write timer values you could
probably get a few pins running at that rate.

Inline assembly is supported, though I've found C in most cases does as well.
core_cm*.c has some examples of the syntax.

Post Reply