Not being able to test 82c55a - Page 1
Forum section: electronics / general

author: gkmaia
author_rank: Frequent Contributor
timestamp: August 02, 2020, 09:39:36 pm
content: 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?

author: MK14
author_rank: Super Contributor
timestamp: August 02, 2020, 09:49:03 pm
content: What about the RESET pin ?

author: DrG
author_rank: Super Contributor
timestamp: August 02, 2020, 10:10:59 pm
content: Quote from: gkmaia on August 02, 2020, 09:39:36 pmHave 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.]

author: gkmaia
author_rank: Frequent Contributor
timestamp: August 03, 2020, 12:18:41 am
content: 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.

author: DrG
author_rank: Super Contributor
timestamp: August 03, 2020, 01:04:13 pm
content: circuit? code?

author: greenpossum
author_rank: Frequent Contributor
timestamp: August 03, 2020, 01:20:21 pm
content: Quote from: gkmaia on August 02, 2020, 09:39:36 pmWhere 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.

author: gkmaia
author_rank: Frequent Contributor
timestamp: August 03, 2020, 07:49:59 pm
content: There is no circuit. I am statically testing it. I will try switching the edge and see if i can get any to move.

author: gkmaia
author_rank: Frequent Contributor
timestamp: August 03, 2020, 10:51:39 pm
content: 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 13int 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");// resetdigitalWrite(CS, LOW);digitalWrite(A1, LOW);digitalWrite(A0, LOW);digitalWrite(RD, HIGH);digitalWrite(WR, HIGH);digitalWrite(RES, LOW);// set modedigitalWrite(CS, LOW);digitalWrite(A1, LOW);digitalWrite(A0, LOW);//set port input datapinMode(PA0, OUTPUT);digitalWrite(PA0, LOW);//enable readdigitalWrite(RD, LOW);// read datapinMode(D0, INPUT);val = digitalRead(D0);Serial.print("LOW -> ");Serial.println(val);Serial.println("Basic ouput opperation mode 0 - read 1");// resetdigitalWrite(CS, LOW);digitalWrite(A1, LOW);digitalWrite(A0, LOW);digitalWrite(RD, HIGH);digitalWrite(WR, HIGH);digitalWrite(RES, LOW);// set modedigitalWrite(CS, LOW);digitalWrite(A1, LOW);digitalWrite(A0, LOW);//set port input datapinMode(PA0, OUTPUT);digitalWrite(PA0, HIGH);//enable readdigitalWrite(RD, LOW);// read datapinMode(D0, INPUT);val = digitalRead(D0);Serial.print("HIGH -> ");Serial.println(val);/////////////////////////Serial.println("Basic input opperation mode 0 - write 0");// resetdigitalWrite(CS, LOW);digitalWrite(A1, LOW);digitalWrite(A0, LOW);digitalWrite(RD, HIGH);digitalWrite(WR, HIGH);digitalWrite(RES, LOW);// set modedigitalWrite(CS, LOW);digitalWrite(A1, LOW);digitalWrite(A0, LOW);//set port input datapinMode(D0, OUTPUT);digitalWrite(D0, LOW);//enable writedigitalWrite(WR, LOW);// writen datapinMode(PA0, INPUT);val = digitalRead(PA0);Serial.print("LOW -> ");Serial.println(val);Serial.println("Basic input opperation mode 0 - read 1");// resetdigitalWrite(CS, LOW);digitalWrite(A1, LOW);digitalWrite(A0, LOW);digitalWrite(RD, HIGH);digitalWrite(WR, HIGH);digitalWrite(RES, LOW);// set modedigitalWrite(CS, LOW);digitalWrite(A1, LOW);digitalWrite(A0, LOW);//set port input datapinMode(D0, OUTPUT);digitalWrite(D0, HIGH);//enable writedigitalWrite(WR, LOW);// writen datapinMode(PA0, INPUT);val = digitalRead(PA0);Serial.print("HIGH -> ");Serial.println(val);}void loop() {}

author: greenpossum
author_rank: Frequent Contributor
timestamp: August 04, 2020, 12:12:48 am
content: 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.

author: DrG
author_rank: Super Contributor
timestamp: August 04, 2020, 01:26:42 am
content: https://www.torretje.nl/Projects/8255

author: gkmaia
author_rank: Frequent Contributor
timestamp: August 04, 2020, 01:27:03 am
content: 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.

author: greenpossum
author_rank: Frequent Contributor
timestamp: August 04, 2020, 04:04:15 am
content: 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.