Author Topic: Not being able to test 82c55a  (Read 1105 times)

0 Members and 1 Guest are viewing this topic.

Offline gkmaiaTopic starter

  • Frequent Contributor
  • **
  • Posts: 534
  • Country: nz
  • Electronics Hobbyist
Not being able to test 82c55a
« on: August 02, 2020, 09:39:36 pm »
Having a hard time to test a 82c55a.

I am following the truth table but I can only send data from the ports to the data bus. And not being able to send the data from data bus to ports.

I am attaching A0,A1,CS,RD & WR directly to gnd OR VCC as required by the table and sending 5v pkpk signals from and to ports/bus.

What am I missing here?
 

Online MK14

  • Super Contributor
  • ***
  • Posts: 4987
  • Country: gb
Re: Not being able to test 82c55a
« Reply #1 on: August 02, 2020, 09:49:03 pm »
What about the RESET pin ?
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Not being able to test 82c55a
« Reply #2 on: August 02, 2020, 10:10:59 pm »
Having a hard time to test a 82c55a.

I am following the truth table but I can only send data from the ports to the data bus. And not being able to send the data from data bus to ports.

I am attaching A0,A1,CS,RD & WR directly to gnd OR VCC as required by the table and sending 5v pkpk signals from and to ports/bus.

What am I missing here?

Have you reviewed the modes and set them as you intended and using the correct ports for the mode? https://ekoharsono.files.wordpress.com/2012/10/5-82c55-programmable-peripheral-interface1.pdf?

[*dayam* I have not thought about that chip in many years.]
- Invest in science - it pays big dividends. -
 

Offline gkmaiaTopic starter

  • Frequent Contributor
  • **
  • Posts: 534
  • Country: nz
  • Electronics Hobbyist
Re: Not being able to test 82c55a
« Reply #3 on: August 03, 2020, 12:18:41 am »
Yes. I am using it as Mode 0 port A B or C. CS A0 and A1 LOW.

I am not going down A0 and A1 HIGH and using the control register.

Just basic data to and from ports flow.

RESET pin is LOW. But it actually does not make a difference when I change it.
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Not being able to test 82c55a
« Reply #4 on: August 03, 2020, 01:04:13 pm »
circuit? code?
- Invest in science - it pays big dividends. -
 

Offline greenpossum

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: au
Re: Not being able to test 82c55a
« Reply #5 on: August 03, 2020, 01:20:21 pm »
I am attaching A0,A1,CS,RD & WR directly to gnd OR VCC as required by the table and sending 5v pkpk signals from and to ports/bus.

Where is the circuit? Are you wiring /RD and /WR directly to GND or VCC statically? You need the rising edge of /WR to latch the bus data to the output pins.
 

Offline gkmaiaTopic starter

  • Frequent Contributor
  • **
  • Posts: 534
  • Country: nz
  • Electronics Hobbyist
Re: Not being able to test 82c55a
« Reply #6 on: August 03, 2020, 07:49:59 pm »
There is no circuit. I am statically testing it. I will try switching the edge and see if i can get any to move.
 

Offline gkmaiaTopic starter

  • Frequent Contributor
  • **
  • Posts: 534
  • Country: nz
  • Electronics Hobbyist
Re: Not being able to test 82c55a
« Reply #7 on: August 03, 2020, 10:51:39 pm »
no success... wrote a small arduino testing flow and still nothing moves between the ports.  :-[

I am testing a couple of them. One is for sure working. definetivelly something I am doing wrong... not sure what.

#include <SoftwareSerial.h>
#include "Arduino.h"

//DATAIN
#define CS          2  // D2  pin15
#define A1          3  // D3  pin 1
#define A0          4  // D4  pin 10
#define RD          5  // D5  pin 9
#define WR          6  // D6   pin 4
#define RES         7  // D7   pin 5
#define PA0         8  // D8   pin 13
#define D0          9  // D9   pin 13

int val = 0;

void resetPins(){
 
  pinMode(CS, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A0, OUTPUT);
  pinMode(RD, OUTPUT);
  pinMode(WR, OUTPUT);
  pinMode(RES, OUTPUT);
  pinMode(PA0, OUTPUT);
  pinMode(D0, OUTPUT);
 
  digitalWrite(CS, HIGH);
  digitalWrite(A1, HIGH);
  digitalWrite(A0, HIGH);
  digitalWrite(RD, HIGH);
  digitalWrite(WR, HIGH);
  digitalWrite(RES, LOW);
  digitalWrite(PA0, LOW);
  digitalWrite(D0, LOW);

 
  digitalWrite(CS, LOW);
  digitalWrite(A1, LOW);
  digitalWrite(A0, LOW);

}

void setup() {

Serial.begin(9600);

////////////////////////////

  Serial.println("Basic input opperation mode 0 - read 0");
 
  // reset
 
  digitalWrite(CS, LOW);
  digitalWrite(A1, LOW);
  digitalWrite(A0, LOW);
  digitalWrite(RD, HIGH);
  digitalWrite(WR, HIGH);
  digitalWrite(RES, LOW);
 
  // set mode
 
  digitalWrite(CS, LOW);
  digitalWrite(A1, LOW);
  digitalWrite(A0, LOW);
 
  //set port input data

  pinMode(PA0, OUTPUT);
  digitalWrite(PA0, LOW);
 
  //enable read
 
  digitalWrite(RD, LOW);
 
  // read data
 
  pinMode(D0, INPUT);
  val = digitalRead(D0);
 
  Serial.print("LOW -> ");
  Serial.println(val);
 
  Serial.println("Basic ouput opperation mode 0 - read 1");
 
  // reset
 
  digitalWrite(CS, LOW);
  digitalWrite(A1, LOW);
  digitalWrite(A0, LOW);
  digitalWrite(RD, HIGH);
  digitalWrite(WR, HIGH);
  digitalWrite(RES, LOW);
 
  // set mode
 
  digitalWrite(CS, LOW);
  digitalWrite(A1, LOW);
  digitalWrite(A0, LOW);
 
  //set port input data

  pinMode(PA0, OUTPUT);
  digitalWrite(PA0, HIGH);
 
  //enable read
 
  digitalWrite(RD, LOW);
 
  // read data
 
  pinMode(D0, INPUT);
  val = digitalRead(D0);
 
  Serial.print("HIGH -> ");
  Serial.println(val);


/////////////////////////

  Serial.println("Basic input opperation mode 0 - write 0");
 
  // reset
 
  digitalWrite(CS, LOW);
  digitalWrite(A1, LOW);
  digitalWrite(A0, LOW);
  digitalWrite(RD, HIGH);
  digitalWrite(WR, HIGH);
  digitalWrite(RES, LOW);
 
  // set mode
 
  digitalWrite(CS, LOW);
  digitalWrite(A1, LOW);
  digitalWrite(A0, LOW);
 
  //set port input data

  pinMode(D0, OUTPUT);
  digitalWrite(D0, LOW);
 
  //enable write
 
  digitalWrite(WR, LOW);
 
  // writen data
 
  pinMode(PA0, INPUT);
  val = digitalRead(PA0);
 
  Serial.print("LOW -> ");
  Serial.println(val);
 
  Serial.println("Basic input opperation mode 0 - read 1");
 
  // reset
 
  digitalWrite(CS, LOW);
  digitalWrite(A1, LOW);
  digitalWrite(A0, LOW);
  digitalWrite(RD, HIGH);
  digitalWrite(WR, HIGH);
  digitalWrite(RES, LOW);
 
  // set mode
 
  digitalWrite(CS, LOW);
  digitalWrite(A1, LOW);
  digitalWrite(A0, LOW);
 
  //set port input data

  pinMode(D0, OUTPUT);
  digitalWrite(D0, HIGH);
 
  //enable write
 
  digitalWrite(WR, LOW);
 
  // writen data
 
  pinMode(PA0, INPUT);
  val = digitalRead(PA0);
 
  Serial.print("HIGH -> ");
  Serial.println(val);

 
 
 
}



void loop() {

}
« Last Edit: August 04, 2020, 12:42:21 am by gkmaia »
 

Offline greenpossum

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: au
Re: Not being able to test 82c55a
« Reply #8 on: August 04, 2020, 12:12:48 am »
Put in the appropriate delays between pin state changes, otherwise you may send pulses of insufficient width. That's what the timing charts are for.
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Not being able to test 82c55a
« Reply #9 on: August 04, 2020, 01:26:42 am »
- Invest in science - it pays big dividends. -
 

Offline gkmaiaTopic starter

  • Frequent Contributor
  • **
  • Posts: 534
  • Country: nz
  • Electronics Hobbyist
Re: Not being able to test 82c55a
« Reply #10 on: August 04, 2020, 01:27:03 am »
Arduino delay ranges up to 1 millisecond. This IC is rated at nanoseconds.

1 millisecond  =  1.000.000 nanoseconds.

Delay wont make a difference here... it is something else.

Have also tried D0 and PA0 as open collectors with 1k res to VCC. No luck.

Thanks for the link. Has some good stuff there.
« Last Edit: August 04, 2020, 02:58:45 am by gkmaia »
 

Offline greenpossum

  • Frequent Contributor
  • **
  • Posts: 408
  • Country: au
Re: Not being able to test 82c55a
« Reply #11 on: August 04, 2020, 04:04:15 am »
Arduino library has delayMicroseconds(). The interval between two successive pin changes can be quite short, as you, the programmer, did not constrain it. Put a scope on it if to be sure. Too short a pulse width hurts, longer doesn't as most of the intervals in the data sheet are minimums.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf