one micro-controller support all adc dac, spi, uart except I2C, but i want to use i2c communication.How to make i2c port using these protocol?
It would help if you told us which microcontroller you are using, and whether you need your micro to be an I2C master, a slave, or either.
If you just need to an I2C master, and you don't need to worry about other masters on the same bus (arbitration) or very slow slave devices (clock stretching), then I2C is very simple to implement using two GPIO pins. Search for " software i2c master" and you'll find things like I2C Implementation on 8051.
If you need to do arbitration because there may be multiple masters on the bus, or if you need to handle slave clock stretching, then read the I2C specification from Philips NXP. Take the simple code you find through Google and add the functionality you need.
Related
I have a problem that I need to control two NFC RC522 over a long distance. Now I saw that there is LTC6820 IC that could make my life easier.
However in the datasheet it can be seen that the SPI slaves need an address to indentify, because the CS pin is not switched separately. Is there any way to classify an RC522 with an address and then be able to use it with an Arduino and the MFRC522 library?
Here is a datasheet of the LTC6820: https://www.analog.com/media/en/technical-documentation/data-sheets/LTC6820.pdf
In the datasheet (https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf) of the RC522 there is something about addressing in the bullet point 8.1.2.3, but I don't understand it yet.
I hope someone can tell me about a multidrop connection with the LTC6820 with RC522 slaves.
The MFRC522 data sheet 8.1.2.3, refers to using SPI to read and write register addresses within the MFRC522 rather than accessing two MFRC5 on the same SPI bus.
The only way to use SPI for 2 separate devices is to run separate CS lines to the CS pin on each IC.
You can also use I2C slave interface and then MFRC522 can be hardwired to several I2C addresses on one I2C bus. I2C can cover somewhat longer distances than SPI, dependent on clock speed you select and can be extended further using differential I2C https://www.nxp.com/docs/en/data-sheet/PCA9615.pdf
Unfortunately it does not look like the official Arduino MFRC522 library has great I2C support though. https://github.com/makerspaceleiden/rfid#what-works-and-not
I am working on Toradex VF-50 SoM using the evaluation board. I have a quectel M10 Modem. The modem is connected to the board using gpio pins and not on the serial port. There are many solutions available for configuring the modem over the serial port. But i need to configure and use the modem over the gpio pins. I have connected the Rx(36),Tx(38),Gnd,Vcc and 5v with the gpio. Now i need a sample code on how to configure and send AT commands over this modem. The os in the SoM is WinCE6. I need to develop the code is Visual Studio 2008. please help...
I do not recommend connecting a modem to GPIOs which do not have UART functionality! This makes your SW unnecessary complex and you load the CPU with work which could be done more efficient by the UART HW.
The Toradex Colibri VF50 has many pins with UART functionality, you can use the Pinout designer to find a good solution for you.
In case there are some good reasons you have to use other pins you can use the GPIOLibary for an easy way to program the GPIOs. It comes with code samples:
http://developer.toradex.com/software/windows-embedded-compact/toradex-ce-libraries-and-code-samples
I don't have a link but I guess there is sample code how to emulate/bit bang a serial port.
I am working with Arduino yun, and I would like to know how can I access sensor values from one arduino using another arduino. Which ways of comunication they are between arduinos? Can I access data from another arduino through wireless? Do I need additional hardware to accomplish this, or its possible with just two arduinos and one computer?
It is possible. Arduinos, depending on the model, can usually communicate via SPI, I2C, etc. Both Arduinos can send and receive data via SPI, for example, so you can hook them up to each other.
It also depends on the type of sensor data you have as well as how many open pins you have: if you really wanted to, you could set 8 bits of data to 8 different pins, and simply connect those pins to 8 pins on the receiving Arduino. That's a rather barbaric way to do it considering you have SPI at your disposal, though.
There are a couple of ways, without any external hardware you have :
SPI
I2C
Serial communication/UART
Serial is the easiest to use among these 3.
And for any other kind of communication you will require external hardware, so if you want to go wireless, then you have cheap RF modules, XBee, etc..
That said that's more appropriate question for Arduino SE site ;)
Check this page. https://www.arduino.cc/en/Tutorial/MasterWriter
I used the I2C to trigger sound from on one arduino and play it on the other. There was no noticeable delay. If you want to stream a lot of data then SPI should be used.
I have a doubt on SPI slaves.
When we pull up the Chip select line, does it disables the whole Slave ( Functionality ) or just the communication module of the slave.
Taking a Ex:
If we have a SPI ADC. When we Pull up the slave , will it disable the ADC conversion process also or just the SPI lines of the ADC will be disabled but the conversion will still in going on?
I may be wrong, but from the research I did while looking into the SPI bus on AVR MCU's, the SPI hardware in the chip works independently of the AVR core. That is to say, whether or not there is data being transferred on the SPI bus, chip functionality shouldn't be directly affected.
I don't know what electronics you're using, but I would assume that toggling the chip-select has no effect on the core function of your peripherals. When in doubt, reference the datasheet of your slave device. It may have some useful insights on the particular SPI hardware.
I hope this helps.
I have an Atmega328 which has to be a slave of an I2c network (because this Atmega is one of the sensors of a bigger network and it's the only available bus), and read+process data from an ADC ADS1100 on request from an I2C master.
I would like to reduce the workload of the master outside of this system: it can't be the mediator of 2 slaves communicating with each other so I have a problem here and I need split the I2C in two so that the atmega can be master of a channel and slave of the other.
Is the library SoftwareSerial compatible with the I2C interface of the ADS1100 so that I can use the proper one with the master and any GPIO for a separate channel toward the ADC? Or do I have to multiplex the proper I2C for listen-acquire-transmit operation? Is there another option?
Thanks in advance.