Extracting ports

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
User avatar
goldwingers
Posts: 118
Joined: Wed Sep 06, 2006 1:22 pm
Location: London
Been thanked: 1 time
Contact:

Extracting ports

Post by goldwingers »

I need to find a solution to extracting each byte of a port ie portb,0 to portb,7.
Then i need to transmit each of these bytes to the RS232 send function as a series of data.

Can anyone help out there

Ian

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Extracting ports

Post by Benj »

Hello Ian

A 8 bit port eg PortB is the equivalent of a Byte of data.

4 bits = 1 nibble
8 bits = 1 byte
16 bits = 1 word or int

Therefore you can transmit it over the RS232 in one action. If you wish to split a byte into 8 bit variables then you can do the following.

Input Icon - B0 - Byte bit0
Input Icon - B1 - Byte bit1
...
Input Icon - B7 - Byte bit7

User avatar
goldwingers
Posts: 118
Joined: Wed Sep 06, 2006 1:22 pm
Location: London
Been thanked: 1 time
Contact:

Re: Extracting ports

Post by goldwingers »

Thanks Benj,
After putting my Q on the forum, I sussed that one out. I can now do what i need thanks.

Post Reply