Go to Post And to think, a lot of students are planning parties and celebrations on their last day of school and you guys are recycling trash. - JaneYoung [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 17:53.

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