I am using MPU 9150 for the first time with Arduino and therefore your answers will be a great help.
I am using I2C communication protocol and in order start getting the raw data I want to know the ID number of MPU 9150 so that communication between arduino and MPU 9150 is made possible.
Thanks.
It's either 0x68 or 0x69. Depending if you pulled the AD0 pin to GND or to VCC.
Related
I am developing a measurement system, comprised of a MCU (being STM, ESP or PIC), multiple (let's say 8) ADCs sending data over SPI. ADCs are to be triggered using a SYNC signal so that they sample at the same time. It's crucial to access the data at the same time (or almost at the same time), the sampling frequency will be 1 or 2 kHz. I'm wondering how should I approach this: use a single physical SPI bus, and perhaps a DMA, or get a MCU with 8 physical SPI buses allowing them to operate in parallel?
Additionally, I would like this MCU to support Ethernet connection, to send the data to a post-processing unit.
My initial thought was to simply get a MCU with 8 SPIs, but maybe it's an overkill?
Hello,
I'm making a project where I want to bit-bang the JTAG protocol.
According to the AN4666 provided by ST, DMA + GPIO can achieve high speeds in bit-banging synchronous protocols.
I want to:
Generate N PWM pulses (the CLK signal).
With the falling edge of each pulses, I want to set some GPIO with DMA.
With the rising edge, I want to read from the GPIO using DMA.
What is the best way to achieve these specs using HAL?
even withtout dma you can reach quite high freq bit banged i/o i'll say in range 2 - 10MHz assuming fast enougth mcu and gpio bus clock high enough (48 96MHz)
Clock just wan't be as stable and may suffer "stall" say idle time when iterrupt occur vs dma. but is way simpler
for DMA base , if you use 3 bit of one port, one for clk and one for TDI and one for TDO then use 2 dma one to wr and one that rd on same timer source (if possible) at double rate of the TCK signal
the data in is rebuilt by taking teh i bit of one read data over 2
index like 0 2 4 or 1 3 5 ... depending on edge you want and how you wr clk array in mem is coded.
last if your jtag chain is 8 bit multiple SPI is even simpler and dma easy ;)
Is it possible to measure 3 specific resistor values by using GPIO / Without using a full ADC setup?
I have an alarm sensor that I want to hook up to my GPIO. This sensor has 3 specific resistors value, based on it's state:
1) Normal - 4k7
2) Alarm - 9k3
3) Tamper - infinite.
Due to long lines, I would prefer 12V power on one side.
I would like to be able to detect these states by 2 normal GPIO input pins.
Is that even possible? What would be the schematic needed for this?
Or is the only solution to use (external) ADC's?
I am thinking about a voltage diver with resistors and a 1N4148 diode to clip it to 3v3. But so far my results are unfruitfull.
Thanks.
The problem here is you have three levels to measure. If we had two we could use a simple resistor divider setup to make (say) the 4k7 and 9k3 outputs on the sensor to logic 0 (<=0.8V) or logic 1 (>=1.3V) on a single GPIO pin. We could do this on two GPIO pins if we had two "independent samples" of the sensor output rather than one.
Given the above it is possible to design some simple logic network to do the comparisons but as the other comment mentions you're off into the realms of electronics.
ADC is the simplest way to go if you want to stay in the software domain. The are other SBC devices e.g. ESP8266 which have onboard ADC functionality and built-in Wifi https://esp8266-projects.org/2015/03/internal-adc-esp8266/ or you can hook up an add-on ADC to the Rpi for example https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters
Good luck
I'm relatively new to the I2C protocol and I have to write a c++ library for a particular sensor I have. I'm using a raspberry pi to interface and wiringpi (the i2c component) to handle the low level communications. This is a pretty standard library (read8bits, read16bits, readbuffer, same for write, that support register operations) so all I need to do is the specific, more higher level, sensor operations and export the sensor data to the main project.
But I have a problem, this particular sensor is a 10DOF IMU sensor
(https://www.waveshare.com/product/10-DOF-IMU-Sensor-C.htm) - which provides temperature pressure accelerometer magnetormeter and gyroscope information - and I've managed to get the pressure and temperature sensor reporting just fine but the MPU component is just odd...
So the sensor registers two I2C addresses, one for the pressure/temperature and one for the accelerometer/magnetometer/gyroscope.
Waveshare has a C library which I am using to understand how the sensor works and, for some reason the library is writing to different addresses (different from the registered ones). This particular sensor registers two addresses, 0x77 and 0x68, which I check with i2cdetect but consulting the code it has a particular address for the gyroscope and accelerometer and a separate one for the magnetometer (0xD0, 0x18 again) which should be the same.
So is it normal to do read/writes on addresses other than the registered ones? Would that even work? What am I missing?
The MPU-9255 is actually 2 separate I2C devices, the accelerometer and gyro are accessed on I2C address 0x68 (or 0x69 depending on the logic level of the AD0 pin), the the magnetometer is accessed on I2C address 0x0C.
The accelerometer and gyro I2C address are covered in section 7.2 of the MPU-9255 product specification. The magnetometer I2C address is in section 4.11.
The values that you are seeing in the code (0xD0 and 0x18) are shifted by 1, which leaves room for the I2C read/write bit.
0x68 << 1 = 0xD0
0x0C << 1 = 0x18
i need some help understanding a specific serial port connection from a sensor. I need to read data from the sensor and make some calculations in matlab or c++ (i will decide later)
The manufacturer only gives a chart with the following details:
Sensor Serial Port
Pin Number Mode Pin Description
I Trigger Input
I RS-232 Receive
O RS-232 Transmit
PWR Sensor Power (DTR)
PWR/GND Signal Ground
Not Used (Reserved)
Not Used (Reserved)
I/O RS-485 B Signal Pin
I/O RS-485 A Signal Pin**
So my question is: OK i know that pin 2 is used to receive data but how am i going to decode the volts stream into integers for example for my program? Also, i know that pin 4 gives power to the sensor. How do i know how many volts it has to give? Generally how am i going to learn all these details since the manufacturer does not give it?
Do you think Serial Port Analyzer Software will help?
Thanks very much in advance.
You might want to search for "DE-9 pinout YourSensorNameHere" in google or This page might be of some use to you. With most RS-232 you only need pins 2,3 and 5. With out more specifics about your sensor there isn't much SO can do for you.