Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2026-09

Arduino project

10 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Adriaan van Os

Maybe someone could advise me as to what Arduino hardware is best supported by FreePascal. My project has the following requirements

1. Read an absolute rotary encoder (SSI data: Line-driver RS422 Diagnostic outputs push-pull)

2. Communicate with a closed-loop stepper motor driver (TMC2209 with ESP32-S3, connectivity CAN, Serial, Wi-Fi, BLE, USB, Qwiic and GPIO)

3. Communicate with an Intel MacBook. Over Wifi, Bluetooth, USB or ethernet ?

Of course, less cables is better, but not a requirement.

I already have a Raspberry Pi, but the application must be used in the field, where there is no 220V, just a 12V or 5V powerbank.

Thanks,

Adriaan van Os

Reply by email

Unknown author
to Adriaan van Os

Raspberry pie just runs a version of linux, so FPC should work just fine on any raspberry pie.  They certainly can be run from a powerbank, I've done it with one of mine multiple times.  I haven't found a way to determine how long the powerbank is going to last, so you'll need to figure out how to do that, or just be prepared for everything to stop when the power runs out.

As for talking to the arduino from linux (the raspberry pie), I haven't tried that myself, but I don't expect it to be any different from when using windows for the host os.

Unfortunately, I don't know what resources for programming arduino boards exist for linux, but it can't be too terribly different from windows, but I've not specifically looked for linux versions of the various serial and/or other communications libraries you'd need to talk to the arduino, but as long as you can port or locate versions for linux, you shouldn't have any trouble with it.

Now you're making me want to experiment.  I never had a need to talk to an arduino from linux, even though I use it regularly, I normally build projects to talk to windows, because that's what most folks I'm building things for use.  This might be a fun project all by itself.

Adriaan van Os wrote 29 lines
Maybe someone could advise me as to what Arduino hardware is best supported by FreePascal. My project has the following requirements 1. Read an absolute rotary encoder (SSI data: Line-driver RS422 Diagnostic outputs push-pull) 2. Communicate with a closed-loop stepper motor driver (TMC2209 with ESP32-S3, connectivity CAN, Serial, Wi-Fi, BLE, USB, Qwiic and GPIO) 3. Communicate with an Intel MacBook. Over Wifi, Bluetooth, USB or ethernet ? Of course, less cables is better, but not a requirement. I already have a Raspberry Pi, but the application must be used in the field, where there is no 220V, just a 12V or 5V powerbank. Thanks, Adriaan van Os _______________________________________________ fpc-pascal maillist https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Adriaan van Os
to Unknown author

Thanks for the reply, but I need to clarify things. The Raspberry Pi would be a replacement for the Arduino, as (1) FPC certainly runs on it and (2) I have one already, But I think it would be overkill and that the Arduino board would use less power.

So the question remains what Arduino board would be best supported by FreePascal, with the requirements mentioned below (which by the way is a star tracker for astro photography).

Regards,

Adriaan van Os

Show quoted text 46 lines
Raspberry pie just runs a version of linux, so FPC should work just fine on any raspberry pie.  They certainly can be run from a powerbank, I've done it with one of mine multiple times.  I haven't found a way to determine how long the powerbank is going to last, so you'll need to figure out how to do that, or just be prepared for everything to stop when the power runs out. As for talking to the arduino from linux (the raspberry pie), I haven't tried that myself, but I don't expect it to be any different from when using windows for the host os. Unfortunately, I don't know what resources for programming arduino boards exist for linux, but it can't be too terribly different from windows, but I've not specifically looked for linux versions of the various serial and/or other communications libraries you'd need to talk to the arduino, but as long as you can port or locate versions for linux, you shouldn't have any trouble with it. Now you're making me want to experiment.  I never had a need to talk to an arduino from linux, even though I use it regularly, I normally build projects to talk to windows, because that's what most folks I'm building things for use.  This might be a fun project all by itself. On 9/11/2026 5:56 AM, Adriaan van Os via fpc-pascal wrote: > > Maybe someone could advise me as to what Arduino hardware is best > supported by FreePascal. My project has the following requirements > > 1. Read an absolute rotary encoder (SSI data: Line-driver RS422 > Diagnostic outputs push-pull) > > 2. Communicate with a closed-loop stepper motor driver (TMC2209 with > ESP32-S3, connectivity CAN, Serial, Wi-Fi, BLE, USB, Qwiic and GPIO) > > 3. Communicate with an Intel MacBook. Over Wifi, Bluetooth, USB or > ethernet ? > > Of course, less cables is better, but not a requirement. > > I already have a Raspberry Pi, but the application must be used in > the field, where there is no 220V, just a 12V or 5V powerbank. > > Thanks, > > Adriaan van Os

Reply by email

Adriaan van Os
to Unknown author: Raspberry pie just runs a version of linux, so FPC should work just fine on any raspberry…

Hm, if I use the Raspberry Pi instead (e.g. with an SSI/RS-485 hat), I am on Linux, have excellent FPC support and I don't need to implement the laptop communications, as I can plug-in a keyboard and portable display ....

Regards,

Adriaan van Os

Show quoted text 59 lines
Thanks for the reply, but I need to clarify things. The Raspberry Pi would be a replacement for the Arduino, as (1) FPC certainly runs on it and (2) I have one already, But I think it would be overkill and that the Arduino board would use less power. So the question remains what Arduino board would be best supported by FreePascal, with the requirements mentioned below (which by the way is a star tracker for astro photography). Regards, Adriaan van Os > Raspberry pie just runs a version of linux, so FPC should work just > fine on any raspberry pie.  They certainly can be run from a > powerbank, I've done it with one of mine multiple times.  I haven't > found a way to determine how long the powerbank is going to last, so > you'll need to figure out how to do that, or just be prepared for > everything to stop when the power runs out. > > As for talking to the arduino from linux (the raspberry pie), I > haven't tried that myself, but I don't expect it to be any different > from when using windows for the host os. > > Unfortunately, I don't know what resources for programming arduino > boards exist for linux, but it can't be too terribly different from > windows, but I've not specifically looked for linux versions of the > various serial and/or other communications libraries you'd need to > talk to the arduino, but as long as you can port or locate versions > for linux, you shouldn't have any trouble with it. > > Now you're making me want to experiment.  I never had a need to talk > to an arduino from linux, even though I use it regularly, I normally > build projects to talk to windows, because that's what most folks I'm > building things for use. This might be a fun project all by itself. > > > On 9/11/2026 5:56 AM, Adriaan van Os via fpc-pascal wrote: >> >> Maybe someone could advise me as to what Arduino hardware is best >> supported by FreePascal. My project has the following requirements >> >> 1. Read an absolute rotary encoder (SSI data: Line-driver RS422 >> Diagnostic outputs push-pull) >> >> 2. Communicate with a closed-loop stepper motor driver (TMC2209 with >> ESP32-S3, connectivity CAN, Serial, Wi-Fi, BLE, USB, Qwiic and GPIO) >> >> 3. Communicate with an Intel MacBook. Over Wifi, Bluetooth, USB or >> ethernet ? >> >> Of course, less cables is better, but not a requirement. >> >> I already have a Raspberry Pi, but the application must be used in >> the field, where there is no 220V, just a 12V or 5V powerbank. >> >> Thanks, >> >> Adriaan van Os

Reply by email

Christo Crause
to Adriaan van Os: Maybe someone could advise me as to what Arduino hardware is best supported by…

I guess by Arduino you are referring to any ready made board where one just hooks up wires?

Here are some thoughts on two types of boards (there are many different boards of course):
- Arduino Uno R4 (esp32-s3 module): Wifi + USB + 1x serial + CAN, higher power consumption, limited FPC support in trunk (workable but not straight forward).
- Arduino Mega (atmega 2560): 3x serial, USB connected to one of the serial ports

Decide up front whether you want wifi or bluetooth connectivity. Then pick a board that can cover the rest of the communication requirements. You need an RS-422 to TTL converter to read the absolute rotary encoder pulses, the diagnostics can be read by any digital input pin (after level shifting of course). Communicating with the stepper driver should be easy (since there are so many different interfaces). Communication with the MacBook / PC can be done over USB, via USB <-> serial converter, or wifi (if using a wifi capable board for example).

Your requirements (at face value) are very light and a small microcontroller should easily handle the tasks.

On Fri, Sep 11, 2026 at 8:41 AM Adriaan van Os via fpc-pascal <

Show quoted text 6 lines
wrote: Maybe someone could advise me as to what Arduino hardware is best supported by FreePascal. My project has the following requirements

1. Read an absolute rotary encoder (SSI data: Line-driver RS422 Diagnostic

Show quoted text 25 lines
outputs push-pull) 2. Communicate with a closed-loop stepper motor driver (TMC2209 with ESP32-S3, connectivity CAN, Serial, Wi-Fi, BLE, USB, Qwiic and GPIO) 3. Communicate with an Intel MacBook. Over Wifi, Bluetooth, USB or ethernet ? Of course, less cables is better, but not a requirement. I already have a Raspberry Pi, but the application must be used in the field, where there is no 220V, just a 12V or 5V powerbank. Thanks, Adriaan van Os _______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Unknown author
to Christo Crause
Christo Crause wrote
I guess by Arduino you are referring to any ready made board where one just hooks up wires?

Close enough, but not exactly, there's lots of the kinds of boards you describe that aren't arduino, but for the sake of this discussion, that definition fits well enough.

Show quoted text 5 lines
Here are some thoughts on two types of boards (there are many different boards of course): - Arduino Uno R4 (esp32-s3 module): Wifi + USB + 1x serial + CAN, higher power consumption, limited FPC support in trunk (workable but not straight forward).

I wasn't aware any of the arduino boards were supported by FPC, I was actually tempted to mention to the op that FPC might not be a good development platform, due to lack of support for arduino boards, but since I hadn't checked to be 100 percent sure, I left that part out of my reply.

Good to know such support is present, that might make some of my projects more accessible to more platforms.

Where does one find the (limited) arduino support that is present in FPC? I'd be curious if any of the boards I have are directly supported.  I realize the difference between arduino boards isn't all that significant, so support for one is at least partially accessible to other arduino boards.  How would one (possibly) contribute to increasing the number of boards supported?

I have probably half a dozen arduino boards here, along with the same number of raspberry pies, as well as micro:bit and propeller/basic stamp boards from parallax.  I'm now beginning to wonder if FPC could be adapted to work with the parallax propeller boards, since they aren't (functionally) all that different from arduinos, just been around a whole lot longer, and have more processors (in most cases)

This is probably a discussion better directed to the fpc-devel list, but I'm just curious how difficult (or easy) it would be to support other boards.

- Arduino Mega (atmega 2560): 3x serial, USB connected to one of the serial ports

Reply by email

Christo Crause

Adriaan,

Typical digital I/O pins can only read single ended values (the pin voltage is interpreted relative to the common ground reference). RS-422 is a differential signal measured between two wires, not relative to common ground. The Github example you mention below is specifically for a single ended electrical interface, the encoder only has a single data connection (D0). Your original specification mentioned the SSI line driver is RS-422, therefore you need an RS-422 to TTL converter. The clock signal may also be RS-422, check encoder datasheet. Arbitrary reference for a longer explanation: https://electronics.stackexchange.com/a/160552

Christo

Show quoted text 19 lines
Christo, Thanks for the reply. > You need an RS-422 to TTL converter to read the absolute rotary > encoder pulses, the diagnostics can be read by any digital input pin > (after level shifting of course). Why is the converter needed ? Because of voltage differences ? This example project <https://github.com/atarbabgei/absoluteEncoderSSI> seems to connect the encoder directly to the Arduino. But I see lots of RS-422 to TTL converters on amazon.fr Thanks, Adriaan van Os

Reply by email

Ralf Quint
to Unknown author: Raspberry pie just runs a version of linux, so FPC should work just fine on any raspberry…
Travis Siegel wrote 8 lines
Raspberry pie just runs a version of linux, so FPC should work just fine on any raspberry pie.  They certainly can be run from a powerbank, I've done it with one of mine multiple times.  I haven't found a way to determine how long the powerbank is going to last, so you'll need to figure out how to do that, or just be prepared for everything to stop when the power runs out.

A Raspberry Pi is NOT an Adruino. No, not even those newer ones that are somehow ARM based...

Ralf

Reply by email

Unknown author
to Ralf Quint
Ralf Quint wrote 12 lines
On 9/11/2026 3:09 AM, Travis Siegel via fpc-pascal wrote: > > Raspberry pie just runs a version of linux, so FPC should work just > fine on any raspberry pie.  They certainly can be run from a > powerbank, I've done it with one of mine multiple times.  I haven't > found a way to determine how long the powerbank is going to last, so > you'll need to figure out how to do that, or just be prepared for > everything to stop when the power runs out. > A Raspberry Pi is NOT an Adruino. No, not even those newer ones that are somehow ARM based...

Never said it was, was just offering a solution that the arduino board wasn't necessary, since the OP talked about talking to a raspberry pie using the arduino board.

Reply by email

Christo Crause
to Unknown author: Close enough, but not exactly, there's lots of the kinds of boards you describe that…

On Sun, Sep 13, 2026 at 4:19 AM Travis Siegel via fpc-pascal <

Show quoted text 17 lines
wrote: On 9/11/2026 4:15 PM, Christo Crause via fpc-pascal wrote: > Here are some thoughts on two types of boards (there are many > different boards of course): > - Arduino Uno R4 (esp32-s3 module): Wifi + USB + 1x serial + CAN, > higher power consumption, limited FPC support in trunk (workable but > not straight forward). I wasn't aware any of the arduino boards were supported by FPC, I was actually tempted to mention to the op that FPC might not be a good development platform, due to lack of support for arduino boards, but since I hadn't checked to be 100 percent sure, I left that part out of my reply.

FPC supports just about all of the AVR controllers used in many of the Arduino boards:
Uno Rev1 - 3, Nano, Pro Mini (atmega328p)
Leonardo, Micro, Pro Micro (atmega32U4)
Nano Every, Uno Wifi rev2 (atmega4809)
Mega (atmega2560)

Show quoted text 6 lines
Good to know such support is present, that might make some of my projects more accessible to more platforms. Where does one find the (limited) arduino support that is present in FPC? I'd be curious if any of the boards I have are directly supported.

FPC supports the AVR controllers but does not provide much in terms of libraries.
Note that FPC supports the microcontrollers, not the boards as such. Some third party libraries/code example:
https://github.com/ackarwow/unolib - Pascal version of some of Arduino's libraries
https://github.com/ccrause/fpc-avr - Pascal examples and libraries

Show quoted text 7 lines
I realize the difference between arduino boards isn't all that significant, so support for one is at least partially accessible to other arduino boards. How would one (possibly) contribute to increasing the number of boards supported? From a compiler perspective the differences between Arduino boards can be

massive.
The controller could be based on AVR, ARM, RISC-V, xtensa or other architecture.
The Arduino ecosystem hides this detail behind lots of abstraction. Board support is an Arduino ecosystem concept, FPC can define an alias for a
board that maps to a controller it supports, but it is not the same thing.

To reproduce the Arduino experience on top of FPC I suggest expanding the Unolib project.

I have probably half a dozen arduino boards here, along with the same

Show quoted text 10 lines
number of raspberry pies, as well as micro:bit and propeller/basic stamp boards from parallax. I'm now beginning to wonder if FPC could be adapted to work with the parallax propeller boards, since they aren't (functionally) all that different from arduinos, just been around a whole lot longer, and have more processors (in most cases) This is probably a discussion better directed to the fpc-devel list, but I'm just curious how difficult (or easy) it would be to support other boards.

Yes, best to enquire on fpc-devel.

Reply by email