You are not logged in.
Hi All,
I'm going to do some HIL simulation on some hardware. Using REX I'm going to run a model to feed back to the hardware I'm testing. I need to use digital POTs as the hardware uses NTC probes for temperature measurements. The digital POTs have SPI so that means coding in REXLANG!
I'm going to use the MCP414X/416X/424X/426X series of POTs, has anyone here had experience coding REXLANG for these? The added kicker is I need to use the dual POT chips as I need 4 analogue inputs and the RPI only has 2 SPI out pins. Could this complicate it?
Data sheet link for those interested, http://ww1.microchip.com/downloads/en/D … 22059b.pdf
Cheers
Mike
Offline
Hi Mike,
awesome project!
I have used DS1844, it has 4 channels and I2C bus. Have you considered it?
If you are forced to use the MCP414X/416X/424X/426X, it should work via REXLANG as you wrote. The 1-channel and 2-channel versions typically use the same communication, only with one additional byte for the 2-channel version. No complication at all, I dare to say.
Kind regards,
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
Hi Jaroslav,
Yes it will be an interesting project for sure. I only picked the MCP series due to having 8 bit and 256 steps. I do think the I2C of the DS1844 is worth considering though. I need good resolution to cover the NTC range I am trying to replicate, -27°C (100K) to +80°C (1.7K)
Cheers
Mike
Offline
Hi Mike,
the DS1844 only has 64 positions. If resolution is the primary concern, the MCP series definitely fit beter.
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline
I'm just trying to confirm hardware for this project. As the Monarco uses the SPI and I2C I will have to use a plain RPi with no hat. Do you have an example of RS485 over USB for the RPi?
The RS485 will provide me with feed back as to what the hardware I'm testing thinks it should be doing! i.e temperature, alarm and status feedback.
Thanks in advance
Mike
Offline
Hi Mike,
you can use example 0501-01 (generic serial communication) or any of the 0401-xx examples on Modbus RTU communication. The USB RS485 adapter will appear as e.g. /dev/ttyUSB0, which you will use as the identifier of the serial bus.
I have the best experience with FTDI-based USB adapters. With other brands I sometimes had problems changing the baudrate.
Kind regards,
Jaroslav
Monarco HAT for Raspberry Pi - Lightweight I/O for monitoring, archiving and control.
Raspberry Pi in industrial automation!
Offline