07-26-2016, 09:03 AM
Yup...that fixed it. Works fine with debian-mate.
I2C Expansion Board
|
07-26-2016, 09:03 AM
Yup...that fixed it. Works fine with debian-mate.
07-26-2016, 10:52 AM
(07-26-2016, 08:51 AM)Artyom Wrote: Thanks Artyom ! Pullup resistors (internal or external) have the same purpose of holding (either weak or strong) an input GPIO at logic level 'high' or '1'. To signal the input, then all the device has to do is provide a 'ground shot'; pulling the input pin low for some period of time. Input switches are often used this way. The internal pullup is cool, because it requires less external circuit components. marcus '
07-26-2016, 11:31 AM
(07-26-2016, 10:52 AM)MarkHaysHarris777 Wrote:Can anyone publish code on C++ to test light and humidity sensor. Simple write to console result of measurements. Do any have this? A I'm new in programming on c++. I am learn...(07-26-2016, 08:51 AM)Artyom Wrote:
07-26-2016, 09:17 PM
On the second I2c Port (TWI-SDA and TWI-SCL), which is connected to the Pin 28 & 29 of Pi-2 Connector, is on port PL8 and PL9 of the MCU. The base address of the MCU I/O configuration register for this Port L is on 0x01F02C00. To enable the I2c function for this pin, we need to configure the PL Configuration Register 1(by default, the MCU disable the i/O function of this 2 pin during power up). The detail of the setting can be found at the MCU User Manual on page 410 to page 416.
I think (some one please correct me if I am wrong) all this setting has to be done in the linux kernel in order for the user land program to be able to access it. Since I am not very good in linux kernal, may be someone which is good in it can help out. Thanks. Regards, KH Goh
07-27-2016, 12:07 AM
(07-26-2016, 09:17 PM)khgoh Wrote: On the second I2c Port (TWI-SDA and TWI-SCL), which is connected to the Pin 28 & 29 of Pi-2 Connector, is on port PL8 and PL9 of the MCU. The base address of the MCU I/O configuration register for this Port L is on 0x01F02C00. To enable the I2c function for this pin, we need to configure the PL Configuration Register 1(by default, the MCU disable the i/O function of this 2 pin during power up). The detail of the setting can be found at the MCU User Manual on page 410 to page 416.Thank you very much.
07-27-2016, 12:51 AM
(07-26-2016, 09:17 PM)khgoh Wrote: On the second I2c Port (TWI-SDA and TWI-SCL), which is connected to the Pin 28 & 29 of Pi-2 Connector, is on port PL8 and PL9 of the MCU. The base address of the MCU I/O configuration register for this Port L is on 0x01F02C00. To enable the I2c function for this pin, we need to configure the PL Configuration Register 1(by default, the MCU disable the i/O function of this 2 pin during power up). The detail of the setting can be found at the MCU User Manual on page 410 to page 416.hello khgoh, i also add my thank you for your work on this issue. i appreciate it. i would like to know if it will be possible in the future , once the kernel issue is resolved, to have both banks [ports] of I2C enabled at same time or if it would be a situation of one or the other at any given time? also, a more general question since this is first time i have had multiple connections to this extent, will these connections be hot-plugable while power on state? what i mean is can i unplug any given connection and plug in something else, like a usb port allows me to do, while the power is on? of course proper care given to handling is understood. thanks again.
07-27-2016, 01:30 AM
(07-27-2016, 12:51 AM)dkryder Wrote:Hi,(07-26-2016, 09:17 PM)khgoh Wrote: On the second I2c Port (TWI-SDA and TWI-SCL), which is connected to the Pin 28 & 29 of Pi-2 Connector, is on port PL8 and PL9 of the MCU. The base address of the MCU I/O configuration register for this Port L is on 0x01F02C00. To enable the I2c function for this pin, we need to configure the PL Configuration Register 1(by default, the MCU disable the i/O function of this 2 pin during power up). The detail of the setting can be found at the MCU User Manual on page 410 to page 416.hello khgoh, For the program that enable the internal pull up on the I2c pin, I already enable the pull up for both of the I2c port. Once the kernel part is resolved, running the program will also turn on the internal pull for the 2nd I2c port. As for hot plugging the I2c device, on the hardware side, all the i2c pin on the POT board and also on the sensor board already build with spike protector to protect the IC during hot plug. So, as far as the hardware concer, It should be no problem for the hardware to connect the device while power on. But on the software application side, your application must also support this feature. Regards, KH Goh
Testing humidity and temperature sensor with KH GOH patch for I2C POT Board.
As you see sensor work. Great thanks all who help solve this problem. If you want repeat this experiment you can download test programm from github.com here: Https://github.com/ControlEverythingComm...C/SI7021.c After downloading source file compile them: gcc SI7021.c -o test Then run it: ./test
07-27-2016, 09:06 AM
Their (controleverything.com) python code for the STS21 module is what I used for some quick testing initially.
https://www.controleverything.com/conten...t_tabset-2 Of course, one could have saved themselves some time if they had just searched a bit more to see that they had a 7021 module of the same type.. https://www.controleverything.com/conten...I7021_I2CS
I had a look at the devicetree-file we use for the Linux kernel. Seems the I2C Interface for pin PL8/9 is not mapped. I then checked the usermanual and found out that this particular interface is actually different from TWI0/TWI1/TWI2.... it is named R_TWI and while it is the same hardware block, it does not sit on the APB2 bus like the others, it sits in the secure domain of the SoC on the APBS bus... so you can't just copy the dts entry from the others, fix the addresses/clocks/pins and call it a day... I am not sure what implications this has for adding it to the devicetree-file but I looked at R_UART - which is already configured (the name in the dts is s_uart though....) and found out that the secure devices have their own pin-control section, so that seems to be doable. What I do not know, what clock needs to be assigned to drive devices on the APBS bus? Also what are the correct IRQ definitions, I looked at the GIC IRQ table from the usermanual but couldnt figure out how the IRQ line numbers and vectors translate to the interrupt entries in the dts...
Come have a chat in the Pine IRC channel >>
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Poll: interest for SPDIF-only POT board? | amp | 0 | 2,803 |
05-01-2019, 11:17 PM Last Post: amp |
|
Audio DAC pot board | nejec | 2 | 7,022 |
12-09-2017, 01:43 PM Last Post: nejec |
|
Zwave Board: 300, 400 or 500? | Lugor | 4 | 9,231 |
01-10-2017, 08:55 PM Last Post: Lugor |
|
Questions. board serial.? | bongky youn | 8 | 12,164 |
09-12-2016, 09:24 AM Last Post: bongky youn |
|
My Board Layout Diagram | UnixOutlaw | 8 | 14,176 |
09-09-2016, 02:41 AM Last Post: pfeerick |
|
New module: POT board | Crispin | 25 | 44,710 |
07-12-2016, 08:47 PM Last Post: khgoh |
|
GPS expansion board | stephen fleming | 3 | 6,439 |
07-06-2016, 11:20 AM Last Post: xalius |