Jump to content

Germ

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. Rei Vilo you are the best! Everything works fine in E17. Now I can finally move on with my project. Thanks for all the help!!
  2. So I tried again the scanner and put my oscilliscope on the I²C lines. I found out that there is something happening but not the way it supposed to be. As you can see in the screen caps (yellow is SCL en blue is SDA) mode 0 is working fine. But when I switch to mode 1 / default. only some low to high transmission is measured on the SDA pin. It looks like the clock pin is trying something but it is forced high. Even when it remove the pull-up resistors and the BME280 nothing happens. I have tried every possible way: removing the pull-up resistors and leave the BME280, removing the BME280 and leaving the pull-up resistor and I have removed anything from the I²C line and just probe them. How is it possible that in another form post this all is working but not in my case? I hope you can answer this or I need to find another low power MCU.
  3. Thanks Rei Vilo for the anwser! I have it working on the hardware pins 14 (SCL) 15 (SDA). But when I try to switch it to pin 9 (SCL) and 10 (SDA) the I2C lines are dead. I'm using 4.7K pull up resistors and a vcc of 3.3V, I don't know what I am doing wrong. For the hardware pins I used : Wire.setModule(1); Wire.begin(); And for the software pins I use: Wire.setModule(0); Wire.begin(); I also tried to remove the Wire.setModule and set it to -1 but still no luck. I have tested this with a I2C scanner. I hope that you can help me further! #include <Wire.h> void setup() { Serial.begin(9600); Serial.println("Start!"); Wire.setModule(0); Wire.begin(); } void loop() { findAddress(); delay(1000); } uint8_t fromAddress = 0; uint8_t toAddress = 127; void findAddress() { for (uint8_t a = fromAddress; a < toAddress; a++) { Wire.beginTransmission(a); int endStatus = Wire.endTransmission(); if (endStatus == 0) { Serial.print("Found device at: 0x"); Serial.println(a, HEX); } } }
  4. Hello, I'm using energia 1.6.10E18 with the launchpad MSP430G2 and the MSPG2553 installed. So I saw that in another forum the library from cactus.io was used for the BME280. That library was for the I2C. Now I want to use the SPI library and they had one.(http://cactus.io/hookups/sensors/barometric/bme280/hookup-arduino-to-bme280-barometric-pressure-sensor-spi). So I installed the library changed it to hardware SPI with the cs pin on P2_1. And it compiled, but i'm only getting these results: 813.81 mb 100.00 % 0.00 *C 32.00 *F 813.81 mb 100.00 % 0.00 *C 32.00 *F 813.81 mb 100.00 % 0.00 *C 32.00 *F 813.81 mb 100.00 % 0.00 *C 32.00 *F It looks like the msp430 is not getting any data in/out. I probed the SPI connections with my oscilloscope en there is literally nothing happening. While with the basic example sketch I can clearly see what code is sending. Can anyone help me understand this problem and hopefully fix this. I want the SPI connection to work because I want the nrf24l01 and BME280 working side by side. The msp430 can't do SPI and I2C together like an arduino so you need to chose between them. This is the code I'm using and the library on the website. #include <SPI.h> #include "cactus_io_BME280_SPI.h" #define BME_CS P2_1 BME280_SPI bme(P2_1); void setup() { Serial.begin(9600); Serial.println("Bosch BME280 Pressure - Humidity - Temp Sensor | cactus.io"); if (!bme.begin()) { Serial.println("Could not find a valid BME280 sensor, check wiring!"); while (1); } Serial.println("Pressure\tHumdity\t\tTemp\ttTemp"); } void loop() { bme.readSensor(); Serial.print(bme.getPressure_MB()); Serial.print(" mb\t"); // Pressure in millibars Serial.print(bme.getHumidity()); Serial.print(" %\t\t"); Serial.print(bme.getTemperature_C()); Serial.print(" *C\t"); Serial.print(bme.getTemperature_F()); Serial.println(" *F"); // Add a 2 second delay. delay(1000); //just here to slow down the output. }
×
×
  • Create New...