Jump to content
43oh

MORA99

Members
  • Content Count

    42
  • Joined

  • Last visited

Everything posted by MORA99

  1. Very nice, I noticed that I get quite a few errors on dht in my project, but I sleep the chip alot so didnt investigate it much. You can send the changes to me by mail if you like, and I will update the github/lib.
  2. Hmm, I didnt think of that, obviously there are more flash than theres ram, so how would I make sure a specific part of my code is loaded in RAM while updating the flash ?
  3. Since this board has been out for longer than the cc3200, maybe there is better hope for a network bootloader ? I found a few discussions on it, but not much to go on, maybe the board is not popular enough, or the ones that figured out how to do it dont share I would like to make the board boot info a bootloader area, preferably a energia sketch, which checks if thers a new firmware available and if so flashes it to the main program area before jumping there. Preferably the boot area would be protected, but even if not theres still the rom bootloader that would allow to recover over
  4. static int8_t readFloatData(unsigned char pin, float *temperature, float *humidity, boolean dht22); The true/false is to set if the sensor is a dht11 or dht22, so thats intended. The main difference is precision and the dht11 requires a bit more delay.
  5. Sorry for late reply, see this thread for changes needed with the current energia release and CC3200 : http://forum.43oh.com/topic/5902-measure-short-amounts-of-time-with-micros/ Problem is that micros (and therefore pulseIn) and delayMicroseconds does not work correctly due to how the tick counter is handled.
  6. The jumper is used in out of box example to force it to run access point mode. The pin is 3v3 compatible, but only if its used as a digital input, if you change to adc mode with the jumper installed it may damage the chip, a bit dangerous.
  7. Yea maybe, I will come back to it later, coming from Avr 8bit its a bit of a transistion working with 32bit magically wifi box
  8. In the final code I will know what state it needs to be, for now its just testing to see what is possible. To run WS2811 code from c I need toggles around 30-70 cycles and some time left to pull the bytes from a array.
  9. Thanks, eventually I will have tight loops ... then we see if its enough
  10. Very nice, now if only we could get smartConfig and networkBootloader
  11. Wonderful the new files works, so it would be better to make a buffer locally before transmitting it to the CC3200 ? I guess most small packages is due to not being able to just string the output together on the fly, like "str"+val, but sprintf can do that. Also tested ssl connect against a rapidssl cert, it connects and sends/recieves data and it fails if I try to ssl connect to a non ssl server, so I think its encrypted, hard to prove though
  12. This is a Websocket client library written mostly in highlevel c(++) to make it easyier to take in. It was tested on a CC3200 and earlier on a TM4C1294 but I think it should work on anything that provides the WifiClient/EthernetClient interface, and has decent amounts of RAM. Current code is a bit rough, it contains debug prints and I have not made much optimization work with it, especially concerning long strings where it just allocates up to 64kbyte of ram, but hopefully the user has some control over what is returned and can keep it short(ish). It does not support frames over 65
  13. I am trying to do some fast bit bang in C to see what is possible without going to asm. But I havent had much luck in doing a simple on/off or toggle using bit manipulation instead of calling digitalWrite. My noble attempt didnt really do much. uint16_t pin; uint8_t port; uint8_t mask; void setup() { pinMode(4, OUTPUT); pin = digital_pin_to_pin_num[4]; //PIN_03 GPIO_12 port = digital_pin_to_port[4]; //S1 mask = digital_pin_to_bit_mask[4]; //BV(4), /* 4 - GPIO_12 */ } void loop() { port ^= mask; delay(500); } I found digitalWrite in the sourcecode, and it
  14. Sorry for derailing this, I am not that familiar with TI to realise which family cc3200 belongs to. It is probaly possible with SPI, a lesser wifi enabled device uses that to control ws2811, but you would be taking up a hardware SPI port, which is a pretty limited resource, maybe an analog switch could multiplex it. One could use a secondary 8bit mcu to offload the timing as long as fast updates are not needed. I see the adafruit avr code is assembler too, ofcause being ~16mhz theres fewer cycles to waste than at 80-120mhz, but 80mhz is still nowhere near enough to do it in c, I tried
  15. Thanks, I got it to compile with some small changes, and the test suite says all good
  16. Works fine on my windows installation too, before I was not able to use printf because it overflowed (.heap can not fit in SRAM), with the new pde.jar "Binary sketch size: 60.152 bytes (of a 262.144 byte maximum)"
  17. Yea I looked at it, hoped it would be compatible Even at 80MHz the timing is pretty tight, 72 cycles for the long delay if I remember correctly.
  18. Any chance of getting this working on cc3200 ? I tried replacing the msp includes to energia.h, and made an attempt at the pin declarations, the compiler isnt impressed though #define WS2811_BITMASK digitalPinToBitMask(3) #define WS2811_PORTDIR portDIRRegister(digitalPinToPort(3)) #define WS2811_PORTOUT digitalPinToPort(3)
  19. A library for reading dht sensors (temperature and humidity). Since dht sensors are pretty slow, I have used highlevel functions in the lib, there should be plenty of cycles even at 1MHz, but I have only tested it on the CC3200 sofar. Easy example, other functions are available for getting the raw values instead of float. if (dht::readFloatData(2, &temperature, &humidity, true) == 0) { Serial.print("T: "); Serial.print(temperature); Serial.print(" H: "); Serial.println(humidity); } Zip file included, source code lives at https://github.com/MORA99/Stoke
  20. Jep, using something along the lines of that bugreport removes the wildly off readings. unsigned long k = 0; void setup() { pinMode(3,INPUT); Serial.begin(115200); // initialize serial communication } void loop() { unsigned long c; unsigned long x = 0; for (uint16_t i=1; i!=0; i++) { c = pulseIn(3, HIGH, 1000); if (c<16||c>24) x++; if (c<10||c>30) Serial.println(c); } Serial.print("Loop ");Serial.print(k++);Serial.print(" => ");Serial.println(x); } Output,each of those loops are about 65500 tests, so <10 errors is not bad, and n
  21. Okay, seems reasonable, so its to make sure both ms and sysTick was read in the same ms section, if ms overflows just as we read those two values, we retry.
  22. unsigned long micros() { register uint32_t ms, cycle_cnt; do { ms = sysTickUptime; cycle_cnt = SysTickValueGet(); } while (ms != sysTickUptime); return (ms * 1000) + (80000 - cycle_cnt) / 80; } Not sure what the purpose of the do while is, to me it will always run just once, since ms is set to sysTickUptime inside it ? unless sysTickUptime counts fast in a interrupt outside of this code. I havent been able to confirm it yet, but I think there is a potential for conflict in both versions, since SysTickValue decrements with 1 per cycle, I think that the ms interrupt wont fire and complete b
  23. For my original needs a few us is plenty precise, I have about 30us difference between the 2 signals I need to differenciate, the one way off reading will just get scrapped in CRC, but in general the big one should be avoided somehow. With the original delayMicroseconds it does not get stuck with values larger than 1000, but you always get about 1ms sleep if you ask for more than 1000us. for (uint16_t i=0; i<16000; i+=250) { delayMicroseconds(i); digitalWrite(3, HIGH); delayMicroseconds(i); digitalWrite(3, LOW); } Capture attached, except for some variation at the start whe
  24. So it seems sysTick are being reset to 80000 when crossing a milisecond (number of cycles in a ms) and then decrements. So a rough fix to micros return (milliseconds * 1000) + (((F_CPU/1000)-SysTickValueGet()) / (F_CPU/1000000)); The timings are not perfect, maybe due to interrupts, but out of 10000 tests, I only had 1 totally off reading, the rest was within +/-5us, with about 90% of them being +/- 1us. void delayMicroseconds(unsigned int us) { volatile unsigned long elapsedTime; unsigned long startTime = SysTickValueGet(); do{ elapsedTime = startTime - SysTickValueGet(); } while
  25. A small ti/avr/arduino board and just using the ESP as a network module is probaly a lot easyier, and not that much more expensive.
×
×
  • Create New...