From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Interfacing Ada With Full Runtime Directly to Electronic Chips Date: Mon, 2 Jan 2017 18:19:26 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <9ca07b79-db85-4d4a-b082-61cd75fcc1c8@googlegroups.com> <20f3a379-e76d-4323-8f1a-a1bb77b93d7e@googlegroups.com> NNTP-Posting-Host: s3c6wwRqkurrfTZpuYYZ+w.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:33007 Date: 2017-01-02T18:19:26+01:00 List-Id: On 2017-01-02 14:28, patrick@spellingbeewinnars.org wrote: > Your suggestions are great and can help but let me give a little more background. > > I have been servicing scientific instruments since 1999(or 1998 part > time). I can repair them just fine but I have done very little circuit > design. I have tinkered with the idea of building my own scientific > instrument for years but I have always put it aside again due to the > start up costs. I have figured out ways to lower these costs and the > idea is back on again. > > The circuits I work on feature tri-state logic and parallel digital > buses. I want to use a serial bus instead. I don't have much hands on > experience with SPI or IC2 but this is probably the way to go for > communication with peripheral devices in-circuit. Probably > I find myself in a strange place. I like Ada and I would like to use > it for embedded design. It has everything that someone might need for > controlling chips yet in the 53lsb of Ada books that I have printed or > bought, I can't find a single example of someone doing this. Regardless how you wire your custom device to the main board you need a driver to deal with it. > It seems to be used as embedded middleware most of the time. Jeol > makes mass spectrometers and uses Ada as they were featured in an > Adacore video: > > https://www.youtube.com/watch?v=NiO7OOmwlrc Embedded as "bare board" or embedded as "small"? > Every single instrument I have worked with and this is well into the > hundreds, is controlled by Windows(which could still be Ada) but I would > like to uses Posix and probably Linux. Instrument as "a [small] computer" or as "a controller/adapter/useless junk if unconnected etc" > Every single instrument uses either a microcontroller or embedded > processor with a small amount of external RAM and Firmware, nothing > close to a computer with full OS at least not to my knowledge. That depends on the instrument. Some consist of not one but multiple full blown computers. > I was thinking that a single board computer with GPIO that ran Linux > could still interface directly with a circuit through on-board GPIO > pins. This would be a huge departure from the instruments I have worked > on already and is a bit scary for a first design. However it would also > provide valuable tools and might shorten the design period. That will need an interface to the outside world and an interface to the circuit. > What does your GPIO setup look like? Under Linux it is a virtual file system with a text file for each DIO pin. For AIO it is several virtual file system files. This stuff is provided through the standard Linux driver. > Is it not PCI based? Could you tell me more. BB does not have PCI. In any case you have to write a driver to allow applications access the circuit. At least one application must run the outside-world interface allowing external PCs to communicate with the instrument. A network based interface is usually the best choice. [ PC ] <--- Ethernet interface ---> [ BB ] Within the BB: [ Application ] | driver | [ SPI or other bus ] | wiring | [ Circuit ] The driver represents the data in the desired form (device class). E.g. GPIO Linux driver represents GPIO pins as virtual files. Reading that file causes scanning the pin potential. CAN controller driver represents CAN messages exchange as a socket [SocketCAN]. The device class choice is up to you and the nature of data. > EtherCat and ModBus look fine but would this mean that Ada would end > up as middleware with a C based microcontroller the likely product on > the other end. I am hoping to stick to a solution without this. No, I don't suggested making your instrument an EtherCAT terminal. Though there are solutions for that too. Beckhoff sells small boards with EtherCAT slave stack and SPI you could use to attach your circuit. But you could not program that thing in Ada. I thought you wanted to attach something like a digital input or incremental encoder. Forget it. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de