comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Interfacing Ada With Full Runtime Directly to Electronic Chips
Date: Mon, 2 Jan 2017 18:19:26 +0100
Date: 2017-01-02T18:19:26+01:00	[thread overview]
Message-ID: <o4e22u$kgs$1@gioia.aioe.org> (raw)
In-Reply-To: 20f3a379-e76d-4323-8f1a-a1bb77b93d7e@googlegroups.com

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

  reply	other threads:[~2017-01-02 17:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02  2:42 Interfacing Ada With Full Runtime Directly to Electronic Chips patrick
2017-01-02  9:14 ` Dmitry A. Kazakov
2017-01-02 13:28   ` patrick
2017-01-02 17:19     ` Dmitry A. Kazakov [this message]
2017-01-03  2:41       ` patrick
2017-01-03  5:33     ` Shark8
2017-01-03 10:34       ` Dmitry A. Kazakov
2017-01-03 18:02         ` Shark8
2017-01-03 20:34           ` Dmitry A. Kazakov
2017-01-03 20:50             ` Shark8
2017-01-03 21:41               ` Dmitry A. Kazakov
2017-01-02 14:02 ` Brian Drummond
2017-01-02 15:02 ` Dennis Lee Bieber
2017-01-02 16:25 ` Simon Wright
2017-01-02 16:46   ` patrick
2017-01-04 19:29   ` antispam
2017-01-04 20:51     ` Simon Wright
2017-01-04 22:05       ` antispam
2017-01-03  7:55 ` philip.munts
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox