Go Down

Topic: Why no byte I/O? (Read 754 times) previous topic - next topic

jontitus

I'm mystified about why the Arduino API doesn't include easy commands to control individual byte-wide I/O ports?  Don't people need to control several bits simultaneously rather than twiddle bits individually?  I don't mind reading the Atmel data books to find info about control registers, shared pins, and so on, but how do I send a byte to a register to control a byte-wide port if there's no register-control operation?  Apologies if I have missed something obvious. --Jon (potential Arduino Due user) 

Arrch


Delta_G

The sad thing on the 328 is that none of the registers are 8 pins wide.  So if you need to parallel in a whole byte it will take at least two registers, a bitshift, an OR operation, and most likely a couple of ANDs.

Msquare

The sad thing is none of the ports are 1 bit wide. You have to read and mask and so on. ;)

retrolefty


The sad thing on the 328 is that none of the registers are 8 pins wide.  So if you need to parallel in a whole byte it will take at least two registers, a bitshift, an OR operation, and most likely a couple of ANDs.


Port D is a full byte wide in the 328 isn't it?

https://spreadsheets.google.com/pub?key=rtHw_R6eVL140KS9_G8GPkA&gid=0

Lefty

majenko



The sad thing on the 328 is that none of the registers are 8 pins wide.  So if you need to parallel in a whole byte it will take at least two registers, a bitshift, an OR operation, and most likely a couple of ANDs.


Port D is a full byte wide in the 328 isn't it?

https://spreadsheets.google.com/pub?key=rtHw_R6eVL140KS9_G8GPkA&gid=0

Lefty

So is port B, but two are normally used for the crystal.

The Arduino doesn't need to provide facilities to deal with a whole byte I/O as the chip does it for you, using the PORTB or PORTD Special Function Registers.
Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Krupski


The sad thing on the 328 is that none of the registers are 8 pins wide.  So if you need to parallel in a whole byte it will take at least two registers, a bitshift, an OR operation, and most likely a couple of ANDs.


Not true. PORTD is UNO pins 7 thru 0. Granted, using pins 1 and 0 screws up serial communications, but an 8 bit full port IS available if needed.

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

michinyon

Nobody seems to be interested in traditional parallel communications anymore,   and there doesn't seem
to be much call for it.

majenko


Nobody seems to be interested in traditional parallel communications anymore,   and there doesn't seem
to be much call for it.

That's because serial communications is so fast now, and parallel communications just takes up too much room.

The only place now in a modern PC where parallel communication is "normal", is in the memory, and that is a mixture of parallel and serial (DDR, etc).
Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Krupski


Nobody seems to be interested in traditional parallel communications anymore,   and there doesn't seem
to be much call for it.


Try interfacing to a graphics LED or LCD to a microcontroller. Serial interface is so slow you can watch the pixels pour onto the screen - one at a time.
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

AWOL

Which do you want to give up?
Fast updates, or at least nine nine of your precious pins?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Krupski


Which do you want to give up?
Fast updates, or at least nine nine of your precious pins?


Depends on what I'm doing. If I need decent graphics performance, I'll use the pins......
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

AWOL

If I need decent graphics performance, I don't use a slow microcontroller.  :)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Krupski


If I need decent graphics performance, I don't use a slow microcontroller.  :)


LOL! We can go back and forth on this all day.......

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

majenko


If I need decent graphics performance, I don't use a slow microcontroller.  :)

If I need decent graphics performance, I use a PIC24FJ256DA210 - it has 3 built-in graphics co-processors and a dedicated LCD / TFT interface.
Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Go Up