Dear Steve,
[I forgot to add tech-talk in my original reply].
I've been using the excellent drvAsynI2C from Florian Feldbauer with the standard StreamDevice on top to read and write the I2C bus on a Raspberry Pi SBC. This works really well and is easy to set up in EPICS.
Some references:
https://github.com/ffeldbauer/drvAsynI2C
https://github.com/paulscherrerinstitute/StreamDevice
The startup file contains:
## I2C configuration
drvAsynI2CConfigure("$(device)", "/dev/i2c-1", 1)
I2C communication is then described using the StreamDevice protocols such as:
# Board DAC
set_dac {
out 0x70 0 8;
out 0x60 "%.2r";
out 0x70 0 1;
}
get_dac {
out 0x70 0 8;
out 0x60 0;
MaxInput = 3;
in 0xc0 "%01r" "%*r";
out 0x70 0 1;
}
get_temperature_card0 {
# Mux card 0 to 'cpld'
out 0x71 2;
# Get data
# Return 2 bytes
MaxInput = 2;
out 0x48 0;
in "%02r";
}
---
These protocols would then be called from the EPICS database records.
[oops, I see that Florian himself answered just now, so will stop here]
All the best
Dr. Bastian Löher
Data acquisition
Experiment controls
Detector development
R3B - Relativistic reactions with radioactive beams
Gamma spectroscopy
-- GSI ------------------------------------------------------------------------
Room / Raum: SB3 3.198 (R3B), SB3 4.162 (Gamma spectroscopy)
Phone / Telefon: +49 6159 71 3272 (Office), 1317 (Messhütte), 2934 (Cave C)
Fax: +49 6159 71 2902
Mobile / Mobil: +49 162 5467038
E-Mail: b.loeher at gsi.de
GSI Helmholtzzentrum für Schwerionenforschung GmbH
Planckstraße 1, 64291 Darmstadt, Germany, www.gsi.de
Commercial Register / Handelsregister: Amtsgericht Darmstadt, HRB 1528
Managing Directors / Geschäftsführung:
Professor Dr. Paolo Giubellino, Dr. Ulrich Breuer, Jörg Blaurock
Chairman of the GSI Supervisory Board / Vorsitzender des GSI-Aufsichtsrats:
Ministerialdirigent Dr. Volkmar Dietz
Additional contact information:
-- TU Darmstadt ----------------------------------------------------------------
Room / Raum: S2|14 418
Phone / Telefon: +49 6151 23532
Mobile / Mobil: +49 162 5467038
E-Mail: loeher at ikp.tu-darmstadt.de
Institut für Kernphysik
Technische Universität Darmstadt
Schlossgartenstrasse 9, 64289 Darmstadt
http://www.ikp.tu-darmstadt.de
________________________________________
Von: Tech-talk <tech-talk-bounces at aps.anl.gov> im Auftrag von Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
Gesendet: Dienstag, 6. Juli 2021 17:48:08
An: Steve Hu
Cc: tech-talk at aps.anl.gov
Betreff: Re: Read I2C data with EPICS
Hi Steve,
This is a fine place to ask that question.
The I2C data could be put into a waveform record and then you can read it with caget.
Can you explain what type of device you are using with I2C and what information do you want to read or write? Sending binary data to an EPICS client like you describe is not the typical way that EPICS is used. The EPICS IOC typically converts that binary data from the device into a more human friendly format, like temperature values, etc.
Mark
________________________________
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Steve Hu via Tech-talk <tech-talk at aps.anl.gov>
Sent: Tuesday, July 6, 2021 3:34 AM
To: tech-talk at aps.anl.gov
Subject: Read I2C data with EPICS
Hello,
I started to use EPICS recently and currently I am learning to use it. I am a french student and I apologize in advance for my bad English.
I just have one question but I don't know if I am in the right place to ask so please tell me if that is the case.
For a project, my internship supervisor want me to use i2c through EPICS and my last problem is to read the data with EPICS IOC like 0x00 0x01 0x02... Is it possible to read these type of data with caget ?
I thank you in advanced for your help.
Sincerely,
Steve Hu.
- References:
- Read I2C data with EPICS Steve Hu via Tech-talk
- Re: Read I2C data with EPICS Mark Rivers via Tech-talk
- Navigate by Date:
- Prev:
Re: Read I2C data with EPICS Florian Feldbauer via Tech-talk
- Next:
fatal error cbf_ad.h with ADPilatus 秦文明 via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
<2021>
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Read I2C data with EPICS Florian Feldbauer via Tech-talk
- Next:
EDM default color and font list definitions Abdalla Ahmad via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
<2021>
2022
2023
2024
|