Multiple logic gates
02 Nov 2024 20:26 #313677
by slowpoke
Multiple logic gates was created by slowpoke
I have numerous gates;OR2, logic, etc. working in a postgui.hal file.
I was using an OR2 for unhoming x&Y and it worked, I'm now trying to include Z
So I now need to add a 3 input OR gate.
I already have a 4 input OR defined as ....
# this is a 4 input OR gate
loadrt logic count=1 personality=0x204 # was 203 for 3 input 0x204 for 4 input A16
addf logic.0 servo-thread
Attempting to add a 3 input like this ....
loadrt logic count=1 personality=0x203
addf logic.1 servo-thread
gives error.... logic: already exists
So I tried changing the count of the logic personality 0x204 to 2, and then just setting the 4th input pin to 0, as follows...
# this is a 4 input OR gate AUG12-2024
loadrt logic count=2 personality=0x204
addf logic.0 servo-thread
addf logic.1 servo-thread
net un-home-x <= arduino.keypad.UnHome-X
net un-home-x => logic.1.in-00
net un-home-y <= arduino.keypad.UnHome-Y
net un-home-y => logic.1.in-01
net un-home-z <= arduino.keypad.UnHome-Z
net un-home-z => logic.1.in-02
setp logic.1.in-03 0
this gives the following error...
postgui.hal:233: Pin 'logic.1.in-00' does not exist
I'm using the same pin naming format that worked for logic.0,
Help please
I was using an OR2 for unhoming x&Y and it worked, I'm now trying to include Z
So I now need to add a 3 input OR gate.
I already have a 4 input OR defined as ....
# this is a 4 input OR gate
loadrt logic count=1 personality=0x204 # was 203 for 3 input 0x204 for 4 input A16
addf logic.0 servo-thread
Attempting to add a 3 input like this ....
loadrt logic count=1 personality=0x203
addf logic.1 servo-thread
gives error.... logic: already exists
So I tried changing the count of the logic personality 0x204 to 2, and then just setting the 4th input pin to 0, as follows...
# this is a 4 input OR gate AUG12-2024
loadrt logic count=2 personality=0x204
addf logic.0 servo-thread
addf logic.1 servo-thread
net un-home-x <= arduino.keypad.UnHome-X
net un-home-x => logic.1.in-00
net un-home-y <= arduino.keypad.UnHome-Y
net un-home-y => logic.1.in-01
net un-home-z <= arduino.keypad.UnHome-Z
net un-home-z => logic.1.in-02
setp logic.1.in-03 0
this gives the following error...
postgui.hal:233: Pin 'logic.1.in-00' does not exist
I'm using the same pin naming format that worked for logic.0,
Help please
Attachments:
Please Log in or Create an account to join the conversation.
02 Nov 2024 21:51 - 02 Nov 2024 21:52 #313679
by PCW
Replied by PCW on topic Multiple logic gates
You probably want something like:
loadrt logic count=2 personality=0x203,0x204
(you need to specify the personality of each gate)
loadrt logic count=2 personality=0x203,0x204
(you need to specify the personality of each gate)
Last edit: 02 Nov 2024 21:52 by PCW.
The following user(s) said Thank You: slowpoke
Please Log in or Create an account to join the conversation.
Time to create page: 0.058 seconds