11 years ago.

Fast digital I/O

About two and a half years ago I wrote an LCD driver program (SSD1963 from Newhaven), driving the display 8 bit I/O port with one of the mbed I/O ports. It was SLOW. I noted that a few other people had also picked up on the Digital I/O speed problem, and there was talk of mbed doing some work on this to speed it up.

Can someone confirm that this is the case, because if it is, I may resurect my project. Thanks

2 Answers

11 years ago.

The mbed's IO code has been optimized afaik, PortOut has been added (at least pretty sure that is less than 2.5 years old), which is way faster than BusOut (although it has some downsides), and there are also some user libraries that allow faster IO operation.

That said the mbed is not ideal for parallel IO, simply because of pin placement.

11 years ago.

The drawback of having a IO lib that supports different chips is that a simple IO operation will end up in more than one instruction. You can speed up things by access direct to the io ports of the LPC1768, but your code will only run on this device. Adding compiler defines like #if defined TARGET_LPC1768 ... can add code specific to the used processor, but it is difficult to handle it for all chips. The next problem with using a bus - there is no LPC1768 IO port with the 8 lower bits accessible. To map a 8 bit value in a register to a port it is the fastest to use a IO port bits 0-7. Resulting in a simple move instruction. But you have to split and shift your bits to different ports to get a 8 bit IO on the mbed. See schematic : http://mbed.org/media/uploads/chris/mbed-005.1.pdf This can be done low level or in assembler to get the fastest speed, but always chip specific.