16 bit transfer in 8 bit uart

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
adpac_1560036
Level 4
Level 4
First like received First like given

Hi,

   

I could separate 16 bit data into two 8 bits,but i couldn't figure out how to transmit,receive and combine them back.

   

-Newbie to PSoc3

0 Likes
1 Solution
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored
uint16_t myint16=((uint16_t)firstbyte)<<8 + secondbyte;

View solution in original post

0 Likes
10 Replies
Anonymous
Not applicable

Hi,

   

If you have split the data array as bytes then all you need to do is PutChar() and GetChar() to send and receive respectively. 

0 Likes

Tried it..could u please elaborate?

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored
uint16_t myint16=((uint16_t)firstbyte)<<8 + secondbyte;
0 Likes

ive got that..but how to write a logic for transmission and reception?..how will the uart differentiate the first and second bytes?

   

thanks in advance

0 Likes

When you configure the UART to send 8 bits, then handling high and low byte is up to your program. You just need to define which one to send first. Then the receiving end takes them in this order and combines them together.

Thanks a lot!!...It Worked

0 Likes

Hello Aditya, 

   

Can you please share the code for 16 bit data transfer in 8 Bit UART as an example. I need the same for my project and want to try this possibility for my case. 

0 Likes

Hello dhans..sorry for the delay..please give me your mail id so that i can share the code. 

0 Likes
lock attach
Attachments are accessible only for community members.

Thanks Aditya!!  I have been offline for long, so could not check the status. I could not move though in my project, I have attached my case for reference and suggestions .. 

0 Likes
dhgac_296796
Level 4
Level 4
First like given

It got solved Aditya. Thanks !!

0 Likes