Shop OBEX P1 Docs P2 Docs Learn Events
BS2e with 96 I/O pins? — Parallax Forums

BS2e with 96 I/O pins?

Jack JordanJack Jordan Posts: 24
edited 2008-09-08 01:18 in BASIC Stamp
I am trying to use a BS2e Rev E in an 8 bit data bus configuration through an 82C55A programmable peripheral controller. I am able to read·selected ports through the 82C55 in an 8 bit binary format to check home position and status switch closure and branch to "some_method".

The BS2e seems to be a logical choice for my 3+ axis project. 8 pins data, 4 pins address, and 4 free pins which will be used later for chip select on·4 seperate·82C55As giving a possible 96 pin bi-directional control system.

The problem I get is logic contentions when the circuit boots. It seems the closed status switch feeds 5v back to the stamp which also boots with all pins high. Is there a way to boot the stamp with all pins low, or am just missing something else?

Thanks
Jack

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-05 15:22
    The Stamp initializes with all I/O pins in input mode. The voltage on them "floats" until they're set to output mode. To provide a known default state, you would need a "pull down" (to ground) or "pull up" (to Vdd) resistor of 4.7K or 10K on the I/O pin(s).
  • Jack JordanJack Jordan Posts: 24
    edited 2008-09-05 15:48
    Thanks Mike. The known state is a must.

    However I'm still missing something in my circuit. I still get logic contentions with pull up or pull down resistors.

    I found that moving chip select out of the Set_Up: method to the Main: method fixed the problem.

    Jack
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-09-05 22:16
    Take a look at this BS2 - 8255 output project I did some time back:

    http://forums.parallax.com/showthread.php?p=561893

    And then for the SX28:

    http://forums.parallax.com/showthread.php?p=613824
    (Code is 3/4 down)
  • Jack JordanJack Jordan Posts: 24
    edited 2008-09-05 23:08
    Thanks Tim. The old thread has usful info.

    I didn't stop to think about how old this stuff is. Guess I need to update my junk box.

    My current project (When compeleted) will allow control of 4 stepper motors (position accuracy) per 8255. Using the 4 free pins for CS gives a total of 16 motors.

    I am interested to know why you set CS low then back high in each method.

    Thanks
    Jack
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-09-06 00:22
    I'm not sure I remember completely but I believe it was something I read in the data sheet that CS had to transition from a low to a high after a write cycle. It works well like it is. Trust me, if it was not needed it would not be like that. I tried many combinations to get the right setup based on the datasheet.

    Do you have any working code yet?

    Keep in mind that the 8255 is quite slow when·switching from output to output as compared to using (3) 74HC595 ICs. So don't use·the 8255·for any larger LED matrix scanning.

    http://forums.parallax.com/showthread.php?p=561990






    Post Edited (T&E Engineer) : 9/6/2008 12:31:16 AM GMT
  • Jack JordanJack Jordan Posts: 24
    edited 2008-09-06 01:27
    Test show that the 8255 (82C55A-5) boots in mode 0, $9B, all ports set to input, based on data sheet info. This reduces the need for code to set up the chip. I have also found that input can be accuried by pulsing the RD pin, output sent by "READ addressData, addressBus" with a pulse to the WR pin.

    I have working code that moniters real world input connected to port A (8 bits) and directs response to port B low, port B high, port C low, port C high.

    I read the input pins "INL" as a binary number and direct output based on the decimal eqivlent. One of 255 possible.

    As for responce time, the BS2e only runs 4k instructions/sec. What i'm doing is reading input and directing output based on predefined data accordingy. The DO - LOOP at this low MHz provides real time data access without timing PAUSE. "PULSOUT RD, 1" , "PULSOUT WR, 1" works great.

    If you see a bug in my logic, PLEASE let me know.
    Jack
  • Jack JordanJack Jordan Posts: 24
    edited 2008-09-08 01:18
    I now have clearance to post basic core code snipit and screen shot.

    Hope this helps.

    jack
Sign In or Register to comment.