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
Extracting ports
- goldwingers
- Posts: 118
- Joined: Wed Sep 06, 2006 1:22 pm
- Location: London
- Been thanked: 1 time
- Contact:
- 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
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
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- goldwingers
- Posts: 118
- Joined: Wed Sep 06, 2006 1:22 pm
- Location: London
- Been thanked: 1 time
- Contact:
Re: Extracting ports
Thanks Benj,
After putting my Q on the forum, I sussed that one out. I can now do what i need thanks.
After putting my Q on the forum, I sussed that one out. I can now do what i need thanks.