I want to use the Arduino Nano as a front-end processor for current and voltage measurements. To do this, I use the I2C interface in slave mode to read from and write to this VI sensor, using another microcontroller in master mode.
Since the Nano already has an ICSP interface, I would like to use this interface for I2C + VCC/GND + interrupt line to connect to the main data processor, which is polling data from the various sensors I have. My idea is to solder the SDA and SCL pins to the MOSI and MISO pins of the ICSP interface and use the standard TWI library. I will not use the SPI functions. I will monitor the state of the SPI enable bit and check that PB3/PB4 (MOSI/MISO) are in a tri-state condition during execution of my software.
Here is my question: given that I monitor the state of PB3/PB4 (MISO and MOSI), can I do this without harming the Nano?
Hopefully someone has already done this. Let me know what you think of my idea and tell me if you have better suggestions.
You could look for a Nano-like board that has one of the "standardish" I2C Connectors ("QWIIC" (Sparkfun) or "Stemma QT" (Adafruit)) (I don't know offhand whether there are any ATmega328p Nano-sized boards that have one of those, though. They showed up mostly with newer chips.)
Is it this board (Fig-1) you are owning? if yes, then you place it on a breadboard and there would be no need to playing with the ICSP connector risking damage to the NANO board.
@wogoos Is the reason that you want to use the ICSP connector because it provides a convenient set of pins to plug a connector onto ?
When you say
Do you literally mean the pins that form part of the 6 pin interface or do you intend to solder to the other side of the board so that you can still use a connector on the ICSP pins ?
In Fig-1, I have shown that when -
SDA signal of MCU is connected with MOSI signal of ICSP, Pin-27 of MCU is shorted with Pin-15 of MCU. Is it safe for the MCU?
Soldering SCL with MISO pin of ICSP results in shorting MCU Pin-28 with MCU Pin-16. Is it safe for the MCU?
I am a cheap guy and want to use the AliExpress nano boards. I plan to hardware wire the SDA and SCL to the MSIO and MOSI pins on the ICSP connector as the description says,
Forbidden means forbidden in digital terms. This means that the input voltage value can result in either a high or low state internally, but which state is unclear. That is why it is forbidden. Forbidden does not mean that it screws up the functionality of the controller or GPIOS. So it’s for me not a problem.
My question is related to a project that I do with the goal to have an ACDC isolated VI sensor that can be applied on any cable installed instead of re-cabling so that the sensor can do its measurements.
Well let me give you an example. let’s say I want to respond on High or Low voltage/current condition within 10 ms. I have an algorithm that can do it in 1ms but that requires one processor per VI interface. The other reason is that my ACDC VI sensor are the size of this Nano so one Nano per sensor as a daughter board makes it a nice tiny intelligent sensor. I connect them in a I2C bus and don’t have to wire the heavy AWG 8 cables to the voltage and current sensors.