Newbie need helpie

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all!

I am trying to become a freak, desperately, but I just can't seem to cut it :) My current challenge is to write a small program (preferrably in C, not assembly) which enables an ATMEL micro to "talk" to my Casio 9750 calculator :oops: yes I freeks too :oops: :lol:

Alberto Ricci Bitti has "cracked" the Casio communications protocol, showing how to mimic the handshaking and sweet-talking the Casio expects when doing Send() and Receive(), one variable at a time: See Ricci's site; in particular his dissection of the Casio protocol!

This circuit can be used in several ways; as an external datalogger (as suggested by Bitti); as the brains of a Casio <-> Casio cable (for "chat programs", or two-player gaming)... And -- most importantly -- as an excellent way for me to learn basic (?) AVR programming :)

At this point I need help :-D
I have set up my spanking new STK500 and got Dean's USART C program working fine within an ATMEGA16, so I'm quite happy! Would someone please help me get a bit further? Questions:

- I assume the Casio uses TTL voltage. How can I test/verify this? And, if so, does this mean I need to include an RS232 (MAX232) chip in the design?

- For debugging/testing, can I connect the Casio directly to some pins on the STK? What about the RX/TX (PD0/PD1) pins of "PORTD"? How can I be sure not to fry the Casio (or the STK)? The Casio uses a standard stereo "minijack" plug for serial comm,

- How do I have the micro execute the "casio protocol" in the correct order while receiving the Send() operation?

So thankful for any and all help!
- joakimk

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If by TTL voltage you mean 0V/5V then I doubt it. The chances are the Casio is 0V/3V3 or (unless there is a "bump" in the PC cable that Casio provide) it might even have a MAX232 style device bumping the voltages to the true RS232 levels.

To avoid frying the Casio you could think about opto isloation but the Casio facing side of that would still need to know what levels it operates at

Surely the person who "cracked the protocol" also documented the physical parameters of the interface though? (unless they are already well documented elsewhere?)

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PS I just read the link you gave it includes this:

Quote:
Using a TTL–to–RS-232 level converter, I connected the calculator to the PC serial port so I could monitor what’s going on

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, I noticed that too. So, just to be stupid, this means that the Casio does in fact expect TTL (which is 0/5V) right?

-Thanks for pitching in :-D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That would seem to be the implication of his statement - yes.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wanted to begin experimenting with Receive() and Send() (those are Casio commands for transferring a variable to/from the Casio) using Bitti's protocol information. I was thinking I'd use Dean's "echo" program as an interface between the Casio and Hyperterminal on the PC. By connecting the Casio to the ATMEGA16, anything sent from the Casio should be received and echoed by the chip, which then sends it to the PC.

Can I connect the Casio directly to the STK, in which the ATMEGA is running, like this:

Then, I "protect" the Casio from 12volt since it's only connected to the TTL voltage at PORTD, right? Should this work?

Also, the protocol involves sending and receiving 50 byte hexadecimal sequences, like this: 3A 52 45 51 00 56 4D FF FF FF FF 41 etc (see full example here). Can I simply change Dean's code from "char ReceivedByte" to something along the lines of "char receivedBytes[50]" to handle the entire sequence?

And, to monitor two-way communication between chip and casio, I could perhaps add an extra connection between the TIP (RX) of the jack, and PD1? Is it possible to branch wires like this in a "comm IO setting"?

-Joakim