This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Programable relationship between pins

Dear members,

I have the following problem: I need that the state of some pins of an 8051 being a logical function of the state of other pins. The difficult is that the logical function must be programmable.
For example: I need that logical state of pin P1.0 must be a logical function of pins P1.1 and P1.2 and the logical functions could be "AND", "OR", or "XOR". I am using an AT89S8252 with 2K of internal EEPROM.
I need some advice, tips, ideas, etc. about how to implement this.
Thanks in advance for your help.

best regards,
JLR
(rodribaires@hotmail.com)

Parents
  • Thanks for the hint :D

    I am trying to implement some sort of PLC, so the user sends the relationship between pins to the uC using the serial port, and I am looking for ideas about how to implement it, i.e: how to store the relationship, how to evaluate the relationship, etc. I am starting with pins only but I also need to add counters and relationships like P3.2 = (P3.1 & (counter > 0x7F))
    By the way, I am using C as programming language

    cheers,
    JLR

Reply
  • Thanks for the hint :D

    I am trying to implement some sort of PLC, so the user sends the relationship between pins to the uC using the serial port, and I am looking for ideas about how to implement it, i.e: how to store the relationship, how to evaluate the relationship, etc. I am starting with pins only but I also need to add counters and relationships like P3.2 = (P3.1 & (counter > 0x7F))
    By the way, I am using C as programming language

    cheers,
    JLR

Children
  • I am trying to implement some sort of PLC
    Hang it up. No PLC user I have ever met would be willing to use anything but ladder logic.
    Making the PLC unit is trivial compared to the PC software for entering and interpreting the ladder.

    This does not mean that some PLC applications, namely those where the same program is loaded in many units, can not be replaced by dedicated '51 boards. Just do not call it a PLC (end user programmable), it never will be. I know of a cases where companies that did a PLC replacement ended up spending so much on programming support of the units that replacing the PLCs came out as a huge loss.

    Erik