Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by MORA99

  1. Yes I think the problem is energia developer didnt take into account CC3200 counts down on its tick counter, dont know about other boards yet. The micros routine may be able to be adjusted to return correct values, then pulseIn should work also. The datasheet said it could be reset by writing, so if the ms interrupt resets the tick counter, then 24bits - currentValue is the number of us since last reset, and since theres only 1000us in a ms, it wont get around to overflow. But 80.000.000 / 16.777.215 is exactly 4, so it will reset on its own every 250ms, but thats only for cc3200 runn
  2. So pulseIn in cc3200 uses micros, which was my problem to start with, so same issue. I made fresh sketch to try and isolate micros problem() Test micro sleeps... for (uint16_t i=500; i<16000; i=i+500) { a = micros(); delayMicroseconds(16000); b = micros(); c=b-a; Serial.println(i); Serial.print("A: ");Serial.println(a); Serial.print("B: ");Serial.println(; Serial.print("C: ");Serial.println(c); } All of those sleeps are between 1000 and 1800us acording to the cpu, but about 3ms acording to my logic analyser. At the very least they should be different, and getting lon
  3. Hmm, the pulsein didnt help, so to check if it could even detect the changes I added a outpin that will be toggled on each change, and it works fine. int8_t dht_getdata(unsigned char pin, short *temperature, short *humidity) { pinMode(3, OUTPUT); uint8_t bits[5]; uint8_t i,j = 0; memset(bits, 0, sizeof(bits)); /* //reset port pinMode(pin, OUTPUT); digitalWrite(pin, HIGH); delay(100); */ //send request pinMode(pin, OUTPUT); digitalWrite(pin, LOW); #if DHT_TYPE == DHT_DHT11 delay(18); #elif DHT_TYPE == DHT_DHT22 delayMicroseconds(500); #endif pinMode(pin, INPUT); digitalWri
  4. I will try pulsein, I am using it for reading a dht sensor, so I dont need super accurate numbers, most of the time I just need to differentiate between 30us and 70us. Originally the code I ported from avr 8bit was just using sleeps, but I changed it to use DigitalRead which seems to be slow enough to offset the sleeps, I tried to measure the time it takes for digitalread when I ran into the micros() running backwards
  5. I am interested in a lib, even if it cant use the current ethernet interface/framework it could be a good fit for dumb sensors that just send/recieve some data.
  6. Tested on CC3200. I am trying to see how long a pin is held in one state, the time will be pretty short at most 100us. So I tried with micros() before and after, but didnt get good results, then I tried timing a simple pinmode and digitalwrite, that gave a negative or very large value... So I boiled it down to this example while(1) { unsigned long i = micros(); delayMicroseconds(100); unsigned long p = micros(); unsigned long o = p-i; Serial.print("Tooki : "); Serial.println(i); Serial.print("Tookp : "); Serial.println(p); Serial.print("Tooko : "); Serial.print
  7. I am writing a websocket client on my CC3200, its working as it is, but its not verifying the sec key the server sends back, so thats next. But to do that I need to hash a value with sha1, and sofar I havent found any libs that compiles (or nearly compiles) on energia. Does anyone have a link to a library that works ?
  8. Seems I misread too I managed to get the Adafruit code working with minor changes : https://github.com/adafruit/Adafruit_TMP006 in Adafruit_TMP006.h add "#define ARDUINO 101" comment out #include <Adafruit_Sensor.h> in Adafruit_TMP006.cpp comment out #include <util/delay.h> To test it Adafruit_TMP006 tmp006(0x41); if (! tmp006.begin()) { Serial.println("No sensor found"); } //tmp006.wake(); float objt = tmp006.readObjTempC(); Serial.print("Object Temperature: "); Serial.print(objt); Serial.println("*C"); float diet = tmp006.readDieTempC();
  9. Maybe, theres already a thread there, stating that it is WIP http://e2e.ti.com/support/wireless_connectivity/f/968/p/364078/1279473.aspx#1279473 On my old 8bit AVR it worked by reserving a small amount of flash at the end for a bootloader and it would then reflash the main program, didnt allow for bootloader upgrades though.
  10. I am fairly sure the accelerometer chip is named BMA222, I havent found one for the temperature sensor yet. Path : \Energia\hardware\cc3200\libraries\BMA222. BMA222 mySensor; mySensor.begin(); //mySensor.readXData(); //mySensor.readYData(); //mySensor.readZData();
  11. In order for this board to reach its full potential, it needs to be programmable in the field, very much preferably without a usb cable and a laptop at the location. From what I can gather the code for the chip is stored in the external SPI chip and when we flash new firmware, we are using the ftdi to send uart to the cc3200 which in turn writes the SPI. Is it possible to replace this bootloader with something that can load a new sketch/hex file over the network ? If not then the only remote programming possible would be a lesser language that is interpeted and any firmware upgrades w
  12. Bit OT, but for simple embedded devices, picaxe could be an option. It has flow control programmming for simple stuff.
  13. Theres a lib for the accelerometer in the hardware folder
  14. Yes, I formatted the device and loaded the service pack. It may be something locally, its connected to a unifi standard ap, which should be connected to the same switch as my PC, although there is a off chance that it picked another AP than the nearest. Since its local traffic the router shouldnt have an effect, theres a HP network printer on the same LAN that broadcasts alot of crap, it has caused issues with lesser ethernet devices before.
  15. /* WiFi Web Server A simple web server that shows the value of the analog input pins. using a WiFi shield. This example is written for a network using WPA encryption. For WEP or WPA, change the Wifi.begin() call accordingly. Circuit: * WiFi shield attached * Analog inputs attached to pins A0 through A5 (optional) created 13 July 2010 by dlf (Metodo2 srl) modified 31 May 2012 by Tom Igoe */ #include <SPI.h> #include <WiFi.h> #include <WiFiClient.h> #include <WiFiServer.h> // your network name also called SSID char ssid[] = "xxx"; // your network pas
  16. While this is pretty neat, it would be really cool if you could do programming from the cloud. As I understand it the code energia makes are the actual c code and it doesnt use a bootloader to get it on the cc3200, it flashes it directly. If there was a small wifi bootloader instead, that could accept either a new hex file, or wiring code
  17. First day with Energia, loaded it onto my 3200 in minutes, so sofar its a lot more user friendly than the TI offer I have been trying out the webserver demo, and noticed that if I dont include a small delay in every println the connection gets dropped, I am guessing this is some buffer being filled faster than it can offload to the webclient. The interesting part of the code is below, in the dummy printouts, if I lower delay to 1 or just remove it, the connection is closed pretty early, 5 seems steady, and 2 was not enough, so somewhere in between. The CC3200 is connected to a loc
  • Create New...