Prox / RFID
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Resume / Consulting
Contact Me

LDmicro Forum - 16 bits on portb

(you are viewing a thread; or go back to list of threads)

16 bits on portb (by kawall)
hello, i have 2 sn74hc540 connected to the same port and i am able to read each chip using C code and assign each bit by name eg sw1,sw2 etc. So using LDMicro how can I read the byte of each sn74hc540 and assigned each bit by name . i want to ab able to say if SW1 then control coil ?. wish you all a good time and thank for any help.
Wed Apr 19 2023, 19:32:56
diagram (by kawall)
f88 and 2 sn74ls540
Thu Apr 20 2023, 08:51:24, download attachment Read_450.png
(no subject) (by MGP)
Here you have an example, read carefully the comments for more explanation.

It should work but I just simulated it.

A good practice on the ifsetbit and ifclearbit instructions.
Thu Apr 20 2023, 12:03:37, download attachment 16F88_8Mhz_INTOSC_ls540.ld
(no subject) (by MGP)
Sorry i posted the wrong file, here is correct version.
Thu Apr 20 2023, 12:08:02, download attachment 16F88_8Mhz_INTOSC_ls540.ld
(no subject) (by MGP)
After the simulation I forgot to remove an instruction in rung 002, so you can remove the instruction mov#PORTB 0xFF in rung 002.
Thu Apr 20 2023, 13:07:46
label a bit as a example a START_Button (by kawall)
Hi my friend,
Thank you very much for the example.Now I would like to refer to a bit as a user label so in Rung a i can say if
Stop_SW then motor1 is on.
Have a good day

Thu Apr 20 2023, 13:25:39, download attachment bit label as button.png
(no subject) (by MGP)
No you can't...but you can use a pic with more pins.
Thu Apr 20 2023, 13:56:08
Post a reply to this comment:
Your Name:
Your Email:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):