Go to Post I read every darn page of this thread. - Paul Copioli [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-12-2003, 03:05
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
EDU Demo Code: Serial Data Transmitter Using a State-Machine

I've written an example software-based serial data transmitter that shows how to implement a state-machine. This transmitter can be used to send asynchronous serial data to external devices using a digital I/O pin. Though it has many uses, I specifically wrote this to send data to a serial LCD. From the header:

This software demonstrates the use of a timer and associated interrupt to precisely clock a software-based serial transmitter which can be used to communicate with other common serial devices like serial LCDs.

In this example we'll setup a timer to generate an interrupt at a rate of 2400 interrupts per second. In response to this interrupt, the microcontroller will execute a specific piece of code called an interrupt handler (see user_routines_fast.c). Within this interrupt handler is a software state-machine that emulates the transmitter section of Universal Asynchronous Receiver/Transmitter (i.e., common PC serial port) running at a baud rate of 2400 bps. The output can be configured to use positive logic for communication with TTL-level serial receivers or negative logic for communication with RS-232 devices that are also compatible with inverted TTL signaling. The TTL serial port on the EDU robot controller can only signal using positive logic.

This code has been sucessfully tested with Scott Edwards Electronics' (
http://www.seetron.com) BPP-420VY and SGX-120L serial LCDs (other than being a satisfied customer, the author has no relationship with this company).

In the zip file I've also included a PDF document that shows how the generated serial waveform should look and how each serial bit maps to a specific state of the state-machine. The code can be found here: http://kevin.org/frc

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #2   Spotlight this post!  
Unread 28-12-2003, 13:52
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: EDU Demo Code: Serial Data Transmitter Using a State-Machine

I've updated the ZIP file to include a RS-232 serial communications primer.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 28-12-2003, 17:02
KevinB's Avatar
KevinB KevinB is offline
Registered User
AKA: Alum
no team
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2001
Location: AL
Posts: 188
KevinB will become famous soon enoughKevinB will become famous soon enough
Send a message via ICQ to KevinB
Re: EDU Demo Code: Serial Data Transmitter Using a State-Machine

Thanks for posting this!

Our electrical team actually had the idea of using an LCD for feedback -- and this will make things easier on us!
  #4   Spotlight this post!  
Unread 28-12-2003, 22:56
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: EDU Demo Code: Serial Data Transmitter Using a State-Machine

Quote:
Originally Posted by KevinB
Thanks for posting this!

Our electrical team actually had the idea of using an LCD for feedback -- and this will make things easier on us!
Cool, I'm glad you can use it. Before you start looking at LCDs with serial interfaces, make sure that it supports TTL-level signaling and the baud rates that this software supports. For ease of use, I'd suggest looking at LCDs that support serial terminal-like interfaces too.

Of course, you're best bet is to find a LCD that can use the hardware serial ports built into the EDU controller (and presumably the full-size controller). If you want to use the dedicated TTL-level serial port, make sure that your LCD supports non-inverted TTL-level signaling.

Here is an great web page that discusses the different ways to communicate with a serial LCD: http://www.seetron.com/ser_an1.htm

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Full list of teams & competitions archiver 2001 14 24-06-2002 00:52
Limiting PWM in pbasic archiver 2001 4 24-06-2002 00:38


All times are GMT -5. The time now is 10:58.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi