Go to Post [In FIRST]...Arab and Israeli students speak on the same level, because they are alliance partners. - Tottanka [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 16-10-2008, 20:37
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
TTL on an Apple IIe

This isn't really FRC related, but it is about robots, so I thought I would post it here. Open house is coming up at my school. I thought it would be interesting to make an automated greeter for the door to the tech room. I have a speaking chip that takes TTL serial input. I also have an old 1984 Apple IIe computer. It does not have a serial port, but it does have a 16 pin game port. The port has several pins that can be toggled easily from 0 to +5 volts with the processor being the only limit to the speed. I need to write a serial protocol for it. I know it can be done, but I am not sure where to start. Any suggestions?
  #2   Spotlight this post!  
Unread 16-10-2008, 20:42
ATannahill ATannahill is offline
Registered User
AKA: Alex Tannahill
no team
 
Join Date: Feb 2008
Rookie Year: 2008
Location: Southfield, Michigan
Posts: 3,259
ATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond reputeATannahill has a reputation beyond repute
Re: TTL on an Apple IIe

I am no expert but I would guess when sonar detects a person (or button in a mat on the floor) send current to the speaker to say "greetings" and if you want use a motor to open the door. If you mean in way of coding I will not be a big help to you.
__________________

- Arizona North
  #3   Spotlight this post!  
Unread 16-10-2008, 21:50
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: TTL on an Apple IIe

Maybe I didn't make myself clear enough. This is a speakJet chip. It generates sounds based on a TTL serial line. I wanted to use my Apple IIe because I really don't have anything else to use. I happen to have it lying around doing nothing. It has a game port on it. The port has a pin that can be pulsed from 0 to +5 easily. I know there is a way to write a serial protocol based on this port because it can be toggled like a digital I/O pin on the FRC controller. I just am not sure where to start.

Forgot to add. I am not worried about detecting people coming in the room. That problem is easily solved. The game port allows for four button inputs. I can read the button states to tell when people walk in.

Last edited by dpeterson3 : 16-10-2008 at 21:59.
  #4   Spotlight this post!  
Unread 16-10-2008, 23:36
dtengineering's Avatar
dtengineering dtengineering is online now
Teaching Teachers to Teach Tech
AKA: Jason Brett
no team (British Columbia FRC teams)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Vancouver, BC
Posts: 1,832
dtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond repute
Re: TTL on an Apple IIe

Interesting project... I'm not sure of a quick way to program a serial driver for the IIe's game port. I was always more of a Commodore 64 guy myself (and it did have an RS-232 serial port, so if you've got one of those kicking around it might make your job easier... I could even scan the relevant pages from the manual and send them along).

But I do know that a cheap PIC chip can be programmed using the "serout" command of PIC Basic Pro (www.melabs.com) to do precisely what you want. Well, what you want from a technical standpoint, that is. There is a certain aesthetic statement in using the IIe, I suspect.

Doing a Google search for RS232 should help you to find documentation on the standards that drive typical PC serial ports, but you'll have to program your own timing loops to send them.

Good luck,

Jason
  #5   Spotlight this post!  
Unread 17-10-2008, 07:04
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: TTL on an Apple IIe

The only other machine I have is an apple IIgs, which I am missing the floopy drive for. You could actually have gotten a serial card for this machine, but mine does not have one. Since it went out of production years ago, I don't think I can get one. Also, the output would require RS232 levels. I need TTL. I guess I was thinking they were different. I know TTL and RS232 are the same, I guess I just wasn't thinking of it that way. Thanks.
  #6   Spotlight this post!  
Unread 17-10-2008, 12:59
Leav's Avatar
Leav Leav is offline
Spud Gun Division
AKA: Leav Oz-Ari
FRC #3316 (D-Bug)
Team Role: Mentor
 
Join Date: Dec 2004
Rookie Year: 2005
Location: Technion, Haifa, Israel
Posts: 774
Leav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond reputeLeav has a reputation beyond repute
Send a message via ICQ to Leav Send a message via AIM to Leav Send a message via MSN to Leav
Re: TTL on an Apple IIe

I really don't think RS232 and TTL are the same...

and i'd like to know if I am wrong, please!

here are some stuff I found online:
http://www.seattlerobotics.org/encoder/aug97/cable.html
http://botrics.com/support/cereb/man...-5-serial.html

Basically they say RS-232 is about +-10 volts
while TTL is 0 to 5v.

-Leav
__________________
"We choose to build robots this season and do the other things; Not because they are easy, but because they are hard."
-Paraphrasing JFK

Participated in FIRST as a student: 2005-2006 (But still learning every season!)
Mentor: 2008 - ? (Team 2630 2008-2011, and Team 3316 since 2013)
Engineer: 2011 - ? (B.Sc. and M.Sc. in Mech. Eng. from the Technion IIT)
FIRST Volunteer - 2007 - ? (MC, FTA, FIRST Aid etc.)
  #7   Spotlight this post!  
Unread 17-10-2008, 14:33
dtengineering's Avatar
dtengineering dtengineering is online now
Teaching Teachers to Teach Tech
AKA: Jason Brett
no team (British Columbia FRC teams)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Vancouver, BC
Posts: 1,832
dtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond repute
Re: TTL on an Apple IIe

An excellent point on voltage levels, Leav. I hadn't really looked in to that in much detail before, because the serial applications I've used have been between PIC microcontrollers and PC's, and I have been able to successfully ignore the voltage specs. Not particularly good practice, perhaps, but it has worked pretty reliably for me.

The PIC Basic Pro Manual in the section on the "Serout" (serial out) command suggests:

Quote:
While single-chip RS-232 level converters are common and inexpensive, thanks to current RS-232 implementation and the excellent I/O specifications of the PICmicro, most applications don't require level converters. Rather, inverted TTL (N300..N9600) can be used. A current limiting resistor is suggested (RS-232 is suppose to be short-tolerant).
Not guarantees that that would work with on old Apple, though. I just know that for a few simple applications using PICs and Pic Basic Pro, I've been able to ignore the differences between TTL and RS-232.

Jason
  #8   Spotlight this post!  
Unread 17-10-2008, 14:54
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: TTL on an Apple IIe

Quote:
Originally Posted by dpeterson3 View Post
I need to write a serial protocol for it. I know it can be done, but I am not sure where to start. Any suggestions?
Start by understanding the timing and bit arrangement of UART serial communications in general, then look at the specifics of your application.

The "idle" state of the data line is a logic 1, which is +5v in the case of TTL. A character begins with a logic 0 start bit, then continues with each of either seven or eight data bits in turn from least significant (the "1"s bit) to most significant (either the "64"s bit or "128"s bit), sometimes inserts an optional parity bit, then ends with either one or two logic 1 stop bits. So each eight-bit character uses either ten or eleven bits of time to send.

The way most serial receivers work, they will function with up to a 9 or 10 percent difference in clock rates between the transmitter and receiver. I assume the BitJet chip will listen at 9600 bps, with 8 data bits and one stop bit. That makes each bit just a little more than 100 microseconds long.

What language will you be using to program the Apple ][? Do you know how to do precise timing with it?
  #9   Spotlight this post!  
Unread 17-10-2008, 15:24
MarkO's Avatar
MarkO MarkO is offline
Registered User
AKA: Mark D. Overholser
FRC #0957 (WATSON Robotics team)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Albany, Oregon, USA
Posts: 17
MarkO is an unknown quantity at this point
Re: TTL on an Apple IIe

My extended family had Commodore's and Atari's, I have an Apple //e.

The Apple ][, ][+, and //e have a couple Apple Made Serial Cards, called "The Serial Card" and "The Super Serial Card". I have a "Super Serial Card" around somewhere, Plus I have an "Echo II Speech Synthesizer" and other Apple and Non Apple peripherals.

TTL is Serial, just like RS-422/485 and RS-232 are, just a different Hardware Interface. There are converters for each of these to the other.

The Apple ][, ][+, and //e have both Analog and Digital Inputs, plus a few Digital Outputs on that 16 pin connector.

I would try to locate an Apple Serial Card (maybe near impossible) or use a Small Micro like in the FRC or Vex Controller to output a TTL Serial Data Stream to the speakJet chip, and use the Apple //e to control it with 0-+5 outputs to the FRC or Vex Controller's Inputs.

If you are limited to the Apple //e, you will most likely need some 6502 Assembler Code to drive the I/O at the Correct rate.

How soon until your Open House???
  #10   Spotlight this post!  
Unread 17-10-2008, 16:02
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: TTL on an Apple IIe

Here's something that might be useful. It's 30 years old, from the January 1978 "Red Book" Apple II manual, but it addresses exactly what you're looking for.

http://apple2history.org/dl/redbook.pdf

See pages 114 through 120. Since you want TTL, you don't need the RS-232 converter circuit shown. There are a few OCR errors in the code listing (most obviously "3" where it should be "B"), but it ought to be helpful. There's a numeric value on one line that is chosen to produce a 9.9 millisecond delay for 110 bits per second. Changing that constant should change the baud rate.

Have fun!
  #11   Spotlight this post!  
Unread 17-10-2008, 19:31
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: TTL on an Apple IIe

Thanks. Open house is in two weeks. I have a Stamp here, but it will hopefully be in use that day. My problem with Pics is that I would have to order one. I don't like ordering on line because I have to borrow a credit card to do it. The same problem occurs with the super serial card. I will check into the links. The good thing is the port I want to use is already at the five volt level. Also, I will be using AppleSoft Basic to program. If there is a way to use asm, I don't know it. Basic gives me direct access to the hardware unlike modern computers though. Language should not be an issue.

FYI, the speakjet chip uses 9600 baud by default but I can configure it to take just about any baud speed. It is also 8 bit no parity ($0054) in Pic Basic.
  #12   Spotlight this post!  
Unread 17-10-2008, 19:52
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: TTL on an Apple IIe

There is a chip that comes in the kit to convert from TTL to RS232 if that is an issue. I don't remember the pinout, but it was used for the CMU cam.

It is called "TTL to RS-232 Converter Board" on the IFI site.
  #13   Spotlight this post!  
Unread 18-10-2008, 09:05
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: TTL on an Apple IIe

The chip takes TTL signals. RS232 signals will fry it.
  #14   Spotlight this post!  
Unread 18-10-2008, 12:22
MarkO's Avatar
MarkO MarkO is offline
Registered User
AKA: Mark D. Overholser
FRC #0957 (WATSON Robotics team)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Albany, Oregon, USA
Posts: 17
MarkO is an unknown quantity at this point
Re: TTL on an Apple IIe

Quote:
Originally Posted by dpeterson3 View Post
The chip takes TTL signals. RS232 signals will fry it.

It is a converter, IIRC the PINS are RS-232 (+12V - -12V) the SOCKETS are TTL (+5V - 0V). So it takes Both types of Signals, just on different Ports.

See Threads:
Serial data out of the programming port
Not enought Serial ports
  #15   Spotlight this post!  
Unread 18-10-2008, 16:55
dpeterson3 dpeterson3 is offline
Registered User
FRC #1178 (DURT)
Team Role: Alumni
 
Join Date: Aug 2008
Rookie Year: 2008
Location: St. Louis
Posts: 158
dpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the roughdpeterson3 is a jewel in the rough
Re: TTL on an Apple IIe

Ok. The driver in the book looks like what I need. I have never done assembly programing before. I have always used higher level languages. I noticed in the comments that the baud rate was 110 baud. Does anyone know how to upgrade this to 9600 baud?
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
TTL Issues Bomberofdoom Programming 4 31-01-2007 09:23
Who says an Apple product can't have a virus? Not Apple. Elgin Clock Chit-Chat 3 18-10-2006 13:21
TTL port diognostics railerobotics Programming 0 16-01-2006 10:46
TTL Ports bludstayne Programming 3 02-03-2004 16:41
TTL pins Dave... Control System 3 07-02-2004 23:59


All times are GMT -5. The time now is 19:28.

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