Jump to content

writing to serial port


Recommended Posts

Hi,

I just want to write a packet to the serial port in hex format . Right now i am writing only command code(88) which is in hex but now i want extend this command to following format (see Pic). Now i need to write command in the given manner . Some one help me how i can do like that. I need to write in hex format but for first bit S, how can i write in hex. Please some one can give me any example. the red circle contains real packet structure used by some other people. the same in i am doing in labview.

post-20037-0-74108000-1299095416_thumb.j

Edited by sjukheter
Link to comment

Hi,

Writing hex codes to serial is the easy bit. What is not clear is how you can send the stop bits and start bit and acknowledge bit. You need to dig out more information first about what those bits are and how they are handled. A hex bite has 8 bits in it so there is not real "hex" code for a stop bit. it must be another bite flag or something that could be driven on another line. have you got any more examples?

Puya

Hi,

I just want to write a packet to the serial port in hex format . Right now i am writing only command code(88) which is in hex but now i want extend this command to following format (see Pic). Now i need to write command in the given manner . Some one help me how i can do like that. I need to write in hex format but for first bit S, how can i write in hex. Please some one can give me any example. the red circle contains real packet structure used by some other people. the same in i am doing in labview.

Link to comment

Hi,

Writing hex codes to serial is the easy bit. What is not clear is how you can send the stop bits and start bit and acknowledge bit. You need to dig out more information first about what those bits are and how they are handled. A hex bite has 8 bits in it so there is not real "hex" code for a stop bit. it must be another bite flag or something that could be driven on another line. have you got any more examples?

Puya

No, but you can see the attchment for whole command structure and command codes(see page 15 , 16 ,55,56 and last pages have all the comand codes in table). My doubt is if i taken start bit as1 one stop bit as 0 then is there any problem in sending lot commands with these bits. In between the start and stop bits i have to send original packet which have hex byte(command code) and address byte. can any one tell me which bits are better to take as start and stop because i think 1 and zero will create problems.

More some times i need send REPEATED START BIT, how can i choose this bit. At last i need to send whole packet as in hex how i can send hex then start and stop bits will change some other..fully confused can any one explaine me...

PMBus_Specification_Part_II_Rev_1-1_20070205.pdf

Link to comment

This is a separate serial bus. Are you tring to use RS-232/UART or some other standard to communicate over this bus?

it seems like you are trying to hack together something together from the VISA commands to emulate device drivers.

i am using usb connectionfrom PC to my controller and controller converts usb to i2c which connected over PMBus to smps.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.