Uno r3 processing speed sufficient?

Hi everyone ..first post ..I was a machine coder in the 80s as well as c and c++

I have a project where I have to read 2 nibbles..they are clocked in parallel so I could do an 8 bit read ..but for the simplicity of the example let's just work with one ...I have another device where the cpu puts out a nibble of data ..the 4 bits are established on the data bus ..a control line goes low indicating the 4 bits are available for processing ..I want to use an ISR routine to sense the control line going low and process the 4 bits into memory on the UNO.. once processed I want to send the result out to and so I or i2c 2 line display.

Every time the control line goes low , 4 more bits are presented on the buss and the control line goes low again ,indicating availability ..This behaviour occurs 7 times populating a character display ...straight up multiplexing ..

The question ...The data window between successive nibbles is around 138uS..
Is there sufficient processing power to read the interrupt ..move the nibble into memory, format it as text and output it to the display... ? ..

I know this is a noob question, I've done some searching but the answers I get are all over the place ...and it represents my lack of knowledge on this processing platform ..


If you are using digital pins for the 4 bits, you need to read each of the 4 pins to get their bit value. Is the remote device using 5 volt logic? Are the 4 bits represented as a high for 1 and low for zero, or the opposite?

Beyond that you just want to set a Boolean to true in the interrupt code and let the "loop" code take care of the 4 bits whenever the Boolean is true, then set it false and ready for the next nibble. Plenty of time. Make the interrupt code as short as possible.

As an aside, are you supposed to send an ack to the device when you have received the nibble?


138┬ÁS is 2208 clock cycles.

handling an interrupt and saving all what needs saving is probably ~50 cycles
reading 4 bits or 8 bits from a PORT takes 1 cycle.
setting a boolean flag that you have data ready is 1 cycle

So that's likely not where the time will go.

Question what's the cost of "format it as text and output it to the display""

Also make sure to connect all 4 datalines to same port taking care of connecting them in right order i.e. endianess. Then u can read all 4 lines at once instead of looping.

The logic is standard 0=0, 1= +v

The only exception is the control line ,which falls to 0 on the trailing edge of the pulse ..

Thanks everyone ...Its hard to get a feel just how fast the arduino can process data .. !

Will let everyone know how I make out..


the challenge is not the processing of the data, it's how fast your display is.

you can read that thread if you plan on using a LCD, @bperrybap has shared some data points for updating a 20x4 display, so 80 symbols.

Just to give you some hd44780 library timing information
(You can get this using LCDiSpeed )

hd44780_I2Cexp at 100khz clock
byte xfer time is 549us
full 20x4 frame update is 46.1ms

hd44780_I2Cexp at 400khz clock
byte xfer time is 198us
full 20x4 frame update is 16.65ms

hd44780_pinIO with direct pin control:
byte xfer time is 92us
full 20x4 frame update is 7.69ms

Using IDE LiquidCrystal with direct pin control:
byte xfer time is 285us
full 20x4 frame update is 23.95ms

I doubt that you have to update the display every time you capture data... nobody can read 8,000 updates a second.

An LCD is not intended to display a movie ( 4x20 positions changing 24 times a second )
Uno speed is way too fast to control human readable changes on an LCD.

Rather think about avoiding flicker by not displaying too many changes :slight_smile: