Shop OBEX P1 Docs P2 Docs Learn Events
ECE388 Embedded Design Project — Parallax Forums

ECE388 Embedded Design Project

Brett245Brett245 Posts: 4
edited 2014-12-06 15:39 in Robotics
A group member and I are creating a magnetic door security system. I know theres many out there and ours will probably function no different. We have a magnetic card reader that outputs is a PS/2 interface. We then have a PS/2 to Serial converter. The serial then goes into our microcontroller (P8X32A). This then will check memory and see if the information on the card matches whats in an offboard EEPROM. If the data matches, an accuator is given power for x amount of seconds (hence simulating the door unlocking for x amount of time). The only thing i seem to be really worried about is how will we be able to read in the serial on the I/O pins 1,2,3? The converter has an inturrupt pin that goes off 5uS before the signal transmits. Any suggestions?

Below is the website for the converters and a schematic that is made (not the final version if changes need to be made):

Magnetic Card Reader:
http://www.adafruit.com/products/854

Converter:
http://www.adafruit.com/products/1136

Microcontroller:
http://www.parallax.com/product/p8x32a-d40

Card_Scanner_Schematic_2.pdf

Comments

  • JonnyMacJonnyMac Posts: 8,993
    edited 2014-10-20 20:20
    You probably don't need the converter with the Propeller. There is a PS/2 keyboard object that you could use directly. I would suggest prototyping your setup to output card data to a terminal.

    You can use this to simplify connections
    -- http://www.parallax.com/product/28060

    The advantage of going this route is you get to see what's coming from the reader -- not what's being filtered by the PS/2-to-Serial interface.
  • Brett245Brett245 Posts: 4
    edited 2014-10-21 05:22
    Thank you Jonny for the reply! We chose to go with the converter because the T.A for the class suggested it and said it would make life easier lol. I'm more concerned with how to read the serial data. Can we make I/O pin 1,2,3 read serial data? I know pins 30 and 31 are serial ports but only on start up.
  • PublisonPublison Posts: 12,366
    edited 2014-10-21 07:12
    Brett245 wrote: »
    Thank you Jonny for the reply! We chose to go with the converter because the T.A for the class suggested it and said it would make life easier lol. I'm more concerned with how to read the serial data. Can we make I/O pin 1,2,3 read serial data? I know pins 30 and 31 are serial ports but only on start up.

    Basically, you can use any pin for serial data, (I would stay away from 28-31 though). Using the FullDuplexSerial or FullDuplexSerialPlus Objects, (found in the Propeller Tool "Library" folder, you assign the pins when you start the object.

    Welcome to the forums!
  • Brett245Brett245 Posts: 4
    edited 2014-10-21 08:16
    Publison wrote: »
    Basically, you can use any pin for serial data, (I would stay away from 28-31 though). Using the FullDuplexSerial or FullDuplexSerialPlus Objects, (found in the Propeller Tool "Library" folder, you assign the pins when you start the object.

    Welcome to the forums!

    Thank You! That's what I was thinking but wasn't sure because I'm fairly new to how serial data transmits and how to get the chip to sync with the clock of the converter. I know the basics but without the devices (we order them this week) I can't figure out a way to read the data. But knowing for sure any pin can be a serial input pin makes me sleep better at night lol.
  • Brett245Brett245 Posts: 4
    edited 2014-12-02 20:54
    I'm in dire need of help. I've searched everywhere and I need help please. I need a program that works with the 40 DIP package.

    The device description is here:

    The clocked data port is a three line connection to the host microcontroller which includes an
    interrupt pulse, serial data, and an active low ~100KHz clock pulse train. A single byte is sent
    to the serial port and then to the clocked data port on the “make” of every keystroke. A serial
    to parallel shift register can be used to capture the clocked data from the E1115B. The INT*
    signal can also be used to indicate that the data has finished being loaded into the shift
    register.Each clocked serial data bit time is approximately 10 usec. The data is output with the most
    significant bit first and the output is inverted. Note that either the rising or the falling edge of
    the SCLK can be used to clock the SDAT into a shift register as the SCLK edges are 3.3 usec
    inside the bit period.

    So for the IC I have:
    P(0) tied to inturrupt
    P(1) tied to SCLK
    P(2) tied to SDat

    I do NOT have any budget left to buy shift registers, and I have tried many many different example programs from the website. I have the PDF of the book on SPIN and I am still stuck. The main problem I'm having is reading in the clocked data at the right time/ being able to get the data that is being pushed out of the E1115B. (its a PS/2 -> Serial Converter).
  • kwinnkwinn Posts: 8,697
    edited 2014-12-03 19:41
    You do not need any additional hardware to make this work. As JonnyMac posted you don't really need the converter chip. There is a keyboard object that will read the data directly from the ps2 keyboard using 2 pins.

    If you insist on using the converter you can use one of the I2C objects to read the data via SCLK and SDat or use one of the serial objects to read the same data using the TX and RX lines. In both cases you will also need a ground connection between the converter and propeller board.
  • Cluso99Cluso99 Posts: 18,069
    edited 2014-12-06 15:39
    As has been said, you could just interface the reader directly into the prop using PS2. There is a PS2 object.

    Anyway, the converter has 2 options..
    1. output a serial character
    2. output a clocked serial character

    The first option will be the easiest. Just connect the TXD and GND connections.
    DR (pin 4) should be linked to 3v3 (pin 8) for 115,200 baud.
    There are no interrupts in the propeller chip.

    Use FullDuplexSerial and start with
    fdx.start(1,-1,0,115200)
    1 assumes that the RX is on P1 (port 1 not pin 1 where the prop has ports 0..31)
    There is no TX output from the prop so use -1 to indicate this.
    The "0" means TTL
    115200 for the baud (FYI baud rate is incorrect as baud implies bit rate).

    There is a demo for using FullDuplexSerial (FDX) that comes with PropTool.

    Perhaps an easy way to get this tested is to run the FDX demo and ensure it works - anything you type on the terminal program (F10 from PropTool) you echo back to the terminal via software in the prop.
    Next, change the demo program to use the input port for your reader & converter rather than P31.
    You now should see the characters being sent to your terminal.

    If I haven't explained this fully, or you have other problems, just ask. There is lots of people just waiting to help you.
Sign In or Register to comment.