Rpi GPIO tester

More
12 Jan 2023 17:17 - 12 Jan 2023 17:19 #261718 by elovalvo
Rpi GPIO tester was created by elovalvo
Inspired by what has been done here (Parallel Port Tester - forum.linuxcnc.org/18-computer/4743-parallel-port-tester#4743) I have prepared a similar test in PyVCP for Raspberry GPIO, to be used with hal_pi_gpio module.

Since, unlike the parallel port, it is possible to define the input and output pins, I chose to define the available odd pins (on the left) as input and use the even available ones (on the right), excluding pin 3 for safety and 5 (GPIO 2 SDA and GPIO 3 SCL)

In this case, via the rpi-gpio utility available here:

 - armhf github.com/jethornton/rpi_gpio
 - arm64 forum.linuxcnc.org/18-computer/43353-rpi...tion?start=10#226664
 
 you can select the function of the pin

 

 

File Attachment:

File Name: rpi_test.zip
File Size:2 KB


As you can see, the command to insert in the rpi_test.hal file is the following
loadrt hal_pi_gpio dir=15561824 exclude=3.

Before using halrun it is necessary to initialize the pins with the raspi-gpio command which, in this case, will be
 
raspi-gpio set 4,17,27,22,10,9,11,5,6,13,19,26 ip pd 
raspi-gpio set 14,15,18,23,24,25,8,7,12,16,20,21 op dl

To run this place both files (rpi_test.hal and rpi_test.xml) in the same directory and open a terminal window and use the command
halrun -I -f rpi_test.hal

 
Attachments:
Last edit: 12 Jan 2023 17:19 by elovalvo.
The following user(s) said Thank You: andypugh, tommylight, TOLP2

Please Log in or Create an account to join the conversation.

Time to create page: 0.166 seconds
Powered by Kunena Forum