From: marcello c. <ca...@fi...> - 2021-04-25 09:57:43
|
hello, Many thanks to Thomas Klima for the latest version of the gpib_bitbang driver with the upgrades. I suggest two further little adjustments: ------------------------------------------------- diff gpib_bitbang.c-thomas-latest gpib_bitbang.c 73c73 < static int sn7516x_used=0; --- > static int sn7516x_used=1; 784c784 < gpiod_direction_output(ACT_LED, 0); --- > gpiod_direction_output(ACT_LED, 1); 816a817 > gpiod_direction_input(ACT_LED); -------------------------------------------------- The first one sets the use of the SN75160/161 bus drivers by default. Everything will work fine in any case, either the chips are actually used or the gpib bus is directly connected to the Raspberry gpios. sn7516x_used=0, instead, leaves the four gpio lines that control the bus drivers uncommitted (available for another use) and only the direct gpib-gpios connection will work. The second one makes the green led on thomas' board light when the module is loaded and switch off when unloaded. ===================================================== I have made a test with the gpib lines connected to the gpios pins through resistors of 10 (ten) ohm value, with four instruments on the bus. Here are the results: Line DIO4 (representative of all data lines): Low: -9 mA (the gpio line is sinking current) @ 270 mV High: 2 mA Line NRFD (representative of all control lines): Low: -10 mA @ 280 mV High: 1 mA According to the numbers, operation of the Raspberry in this condition is safe and there is room also for some more instrument. I will test and report about this as soon as I can. Operation with the SN7516x bus drivers though is safer and by far more advisable if one is not 100% certain of what can be going on his gpib bus. Good bye Marcello Carla' On 4/22/21 3:21 PM, dave penkler wrote: > Hi Thomas, > Excellent, thank you. Will apply your patch and test builds on the weekend. > cheers, > -Dave > > On Thu, 22 Apr 2021, 13:16 Thomas Klima, <ele...@gm... > <mailto:ele...@gm...>> wrote: > > Hi, > > congratulations on the newest release of linux-gpib - I love that the > bitbanging driver is now included in linux-gpib! > > Since 2016 i developed a GPIB-shield for the raspberry pi and a > patch to linux-gpib as driver on my project page (elektronomikon.org > <http://elektronomikon.org>). > > Marcello helped me with an interrupt-driven design, and his current > version is much more elegant than mine but is missing two features > which imho would warrant looking after: > > 1, The driver in linux-gpib V4.3.4 is uses the legacy gpio kernel > interface which is marked deprecated for some time now. The > raspi_gpib driver uses the GPIO descriptor based interface. > 2, My project includes SN75160/161 driver IC's which need three > extra pins and are unused in the upstream driver. > > So i added both changes to the upstream version, which yields the > following file: > https://github.com/elektronomikon/raspi_gpib_driver/blob/master/for_linux-gpib-4.3.4/gpib_bitbang.c > > Marcello tested this on his hardware which ran fine. > > The use of SN75160/161 is currently en/disabled via a module parameter, > which i think is an acceptable solution. Aa config file switch would be > another possibility, but i dont know how to implement this... Any hints > are appreciated :-) > > Patch is attached, please apply. > > Greetings, > Thomas Klima > _______________________________________________ > Linux-gpib-general mailing list > Lin...@li... > <mailto:Lin...@li...> > https://lists.sourceforge.net/lists/listinfo/linux-gpib-general > > > > _______________________________________________ > Linux-gpib-general mailing list > Lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-gpib-general > -- Marcello Carla' (ca...@fi...) |