Utah DNUG User Group Notes & Review :: Lets get Physical!

Posted Friday, July 18, 2008 11:14 AM by Nathan Zaugg

Environment

I have to admit, I was very excited when I saw this was going to be a topic for the users group meeting.  I am very interested in hardware!  I remember building my own connector to the computer to communicate with my calculator (TI-86).  I always wondered how it worked smile_wink so when I saw the topic I was very excited to might learn some of this stuff.

It has been quite a while since I've been to a users group meeting here, but I can never find where we meet.  I don't remember what floor or what room and there are never any posters or signs.  The meeting started 15 min's late because the presenter was caught in traffic!  Also, the wireless at Neumont is always locked down and it really sucks not having Internet when we're group programming and need to know the format string for a DateTime.TryParseExact!  Pizza and drinks were plentiful and that is always nice!

The presenter started out apologizing for poor content, usually not a good sign!  However he really did seem to know his stuff and came prepared to amaze us with his gobs of cool hardware.  He is kind of a quiet talker and while I was near the back of the room I was still plenty close to be able to hear and I had to really strain to hear.  If he didn't have code on the screen most of the time I probably wouldn't have gotten much out of it.

I was a little annoyed that we had to wade through the code creation process.  Although this is something I like to do in my presentations I only apply it in cases where the topic I am presenting is new.  Parsing strings in C# is something we all do all of the time and it was annoying to sit around for over an hour waiting for the code to be created.  I was really disappointed when that resulted in skipping Ethernet and Wireless connectivity.  I didn't mind so much that the final application wasn't written.  I didn't actually even expect anything polished as this is a users group meeting.  About two minuets into looking through the code he did have I was satisfied and we could have moved on from there.

Presenter: Josh Perry - 6bit Inc.

http://www.6bit.com/

Sponsor: MindCenter sponsor

http://www.MindCenter.net

The Serial Port

  • RS (Recommended Standard)-232C
  • Defined in 1969
  • DTE (Data Terminal Equipment) - Client
  • DCE (Data Circuit-terminating Equipment) - Server

Physical

  • Computers wired as DTE
  • Devices (modems, etc..) wired as DCE (usually)
  • DE-9 most common connector
  • DV-25 (25 pin serial connector)

Pin-outs (DE-9)

  • RX - 2
  • TX - 3
  • GND - 5
  • RX on DTE goes to TX on DCE
  • TX on DTE goes to RX on DCE
  • NULL-Modem

Serial - Electrical

  • +12v to -12v swing; +12v = 1 - 12v = 0
  • Single ended communication, common ground
  • Small and embedded systems need level converters and inverters to go from logic to serial levels
  • Oscilloscope trace of serial communication

Serial - Protocol

  • Time-based sampling
  • Baud rate is the frequency of bytes
  • Bit rate is 8 * baud + 1 (start bit) + stop bits + Parity
  • Most common is 8 bit bytes, no parity, and 1 stop bit
  • Baud varies a lot, but 9600 and 115500 are popular
  • With only RX, TX, and ground; flow control is none or XON-XOFF. None is most common, XON-XOFF causes problems with binary communications.

Byes are send LSB first if you scope a serial connection under hyper terminal. 

We are implementing the NMEA protocol which is a standard maritime protocol that was first implemented for boats.  It is an ASCII protocol.  Each sentence is 1 line terminated with a CRLF.  Comma delimited with each of the values.

Atmel chips are a good way to get started.

The .net microframework chips allow you to program chips using the .net framework.  

Links