Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Serial Ports


  • Please log in to reply
4 replies to this topic

#1 Pritch1

Pritch1

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:19 PM

Posted 19 October 2012 - 04:05 PM

Good Day All,

I am working on a project in visual studio 2010 using visual basic. I am trying to send out some data through a serial port on my computer to a micro-controller. If i were to transmit the number 180,000 for example, what actually gets sent? Does it convert it to binary and send it? Or does it convert it to ascii and send the binary representation of that number? I have to program the micro-controller to be able to receive and interpret what is being received. So i need to know exactly what is being sent and received.


Any help would be appreciated

Edited by Pritch1, 19 October 2012 - 04:06 PM.


BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:06:19 PM

Posted 19 October 2012 - 04:19 PM

I would have to guess that there would be some documentation to help you with that. If not, a see if they have a support forum. Micro-controllers are a little specialized, so I would think you might have better luck there.

#3 Pritch1

Pritch1
  • Topic Starter

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:19 PM

Posted 19 October 2012 - 04:35 PM

I would have to guess that there would be some documentation to help you with that. If not, a see if they have a support forum. Micro-controllers are a little specialized, so I would think you might have better luck there.


I just need to know how the data is sent via the serial port and then i can tailor the micro-controller to be able to use what is being sent. Or perhaps there is a way for me to change how the data is transmitted? I have tried researching it but have come up with nothing.

Edited by Pritch1, 19 October 2012 - 04:38 PM.


#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:06:19 PM

Posted 20 October 2012 - 08:03 AM

These should answer your first question:
I googled 'how data is set through a serial port'.
Same google query

Here is some info that may be helpful:
This page has s vb code sample. I googled 'vb code samples serial port'

Again, you are going to have better luck on a hardware forum.

#5 Pritch1

Pritch1
  • Topic Starter

  • Members
  • 5 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:19 PM

Posted 20 October 2012 - 10:39 AM

Thanks for your help. I'm probably not being clear. I understand how the data is physically transmitted through the serial port (ie handshaking, baud rate, stop bit, parity etc.). What I need to know is what happens to my data before it is sent. Right before it is sent through the serial port it will be converted to binary, but what happens before that?

So what i want to know is if i transmit the number 10, will it just convert that to binary (00001010) or does it break each part of it down into ascii and transmit the ascii value of each number.

Example: The number 1 in ascii is 31 hex or 00110001 in binary and 0 in ascii is 30 hex or 00110000 in binary so it would transmit (00110001 00110000)

I'm guessing it would break it into ascii, because if were to transmit a character i believe it would convert it to ascii first. I just want to make sure. The data the micro-controller receives will have to be interpreted to be useable so if it transmits the numbers in ascii i will have to write a function to convert 00110001 00110000 to 00001010


I probably just made this more confusing
I will try posting this in a hardware forum as well but if anyone can answer this for me i would appreciate it
Thanks again for helping

Edited by Pritch1, 20 October 2012 - 11:47 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users