UART, I2C, SPI interfaces at Gemalto Concept Board | Thales IoT Developer Community
March 3, 2016 - 3:27pm, 2826 views
Hi Experts,
Is it possible to use simultaneously UART and SPI interfaces at Gemalto Concept Board?
If no, maybe it's possible to use UART and I2C at the same time? What should be the settings in such case? Now, I use default sett.:
AT^SCFG?
^SCFG: "Call/ECC","0"
^SCFG: "GPRS/AutoAttach","enabled"
^SCFG: "Gpio/****/ASC1","std"
^SCFG: "Gpio/****/DAI","gpio"
^SCFG: "Gpio/****/DCD0","std"
^SCFG: "Gpio/****/DSR0","std"
^SCFG: "Gpio/****/DTR0","std"
^SCFG: "Gpio/****/FSR","gpio"
^SCFG: "Gpio/****/HSIC","rsv"
^SCFG: "Gpio/****/PULSE","gpio"
^SCFG: "Gpio/****/PWM","gpio"
^SCFG: "Gpio/****/RING0","std"
^SCFG: "Gpio/****/SPI","rsv"
^SCFG: "Gpio/****/SYNC","gpio"
^SCFG: "Ident/Manufacturer","Cinterion"
^SCFG: "Ident/Product","EHS6"
^SCFG: "MEShutdown/Fso","0"
^SCFG: "MEopMode/SoR","off"
^SCFG: "Radio/Band","511"
^SCFG: "Radio/OutputPowerReduction","4"
^SCFG: "Serial/Interface/Allocation","1","1"
^SCFG: "Serial/USB/DDD","0","0","0409","1E2D","0058","Cinterion Wireless Modules","EHx",""
^SCFG: "Tcp/IRT","3"
^SCFG: "Tcp/MR","10"
^SCFG: "Tcp/OT","6000"
^SCFG: "Tcp/WithURCs","on"
^SCFG: "Trace/Syslog/Otap","0"
^SCFG: "URC/Ringline","local"
^SCFG: "URC/Ringline/ActiveTime","2"
^SCFG: "Userware/Autostart","1"
^SCFG: "Userware/Autostart/Delay","0"
^SCFG: "Userware/DebugInterface","0.0.0.0","0.0.0.0","0"
^SCFG: "Userware/DebugMode","on"
^SCFG: "Userware/Passwd",
^SCFG: "Userware/Stdout","null",,,,"off"
^SCFG: "Userware/Watchdog","0"
Regards,
Wojciech
Hello,
Some lines are common between ASC0, ASC1 and SPI. So for SPI you should set Gpio/****/SPI" to "std". In that case some of the common lines will be switched to "rsv". I2C does not share it's lines with other interfaces.
Please see the table form EHS6 hardware description.
Regards,
Bartłomiej
Thank you Bartłomiej for your fast responce.
Any special settings are required for I2C use?
I receive java.lang.NullPointerException at line: " ch = inStream.read();" when I run my simple code:
try {
i2cCC= (I2cBusConnection) Connector.open("i2c:0;baudrate=400");
inStream = i2cCC.openInputStream();
outStream = i2cCC.openOutputStream();
int ch = -1;
while(true){
ch = inStream.read();
System.out.print((char)ch);
}
} catch (IOException ex) {
ex.printStackTrace();
}
Regards,
Wojciech
Hi Wojciech,
I once used I2C to read from temperature sensor. It has been only once and more then a year ago, so I hope that this is correct code and it can help you:
Hello Wojciech,
You don't need additional configuration. The code fragment you have pasted seems correct. Even when something would not be connected properly you should not get this exception. NullPointerException usually is thrown when some variable has not been initialized so it usually means some bug in the code. Are you sure that it is thrown at this line? Can you paste the stack trace?
Regards,
Bartłomiej
I ran my code after IDE restart and it works properly.. No idea what was the issue :)
Anyway, thank you guys for your help!
Regards,
Wojciech