Jump to content
43oh

bobnova

Members
  • Content Count

    161
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by bobnova

  1. twi.h has a speed setting early in it. It looks like you might be able to define "TWI_FREQ" in your code before you include Wire.h (which includes twi.h, which checks to see if TWI_FREQ is defined and if not, defines it) and set the speed that way. twi.h kicks off with figuring out what sort of serial interface the MCU has, then hits the speed section: #ifndef TWI_FREQ #define TWI_FREQ 100000L #endif My guess is that it's in Hz, 100kHz seems like a reasonable default speed. Will it work faster? I have no idea.
  2. If it knows its altitude and it and you are both on relatively flat ground it could take a radio direction finder reading on something the watch is broadcasting. Some triangle math would give it a rough distance to you. I don't know how small radio direction finders are these days, though. I suppose you could make one with a sensitive enough loop antenna and rotating the quad to rotate the antenna.
  3. Ouf, I feel silly. That was it. Added "WDTCTL = WDTPW + WDTHOLD;" and voila, it sleeps interrupts enabled and wakes on pin interrupts. It doesn't stay awake, but I know where to go for that. I was looking at that section of the datasheet yesterday. Having gone back through the datasheet yet again I think I know what the problem was. The FR5969 checks to see of moldules are requesting clock access/source and limits what LPMs are available based on that. The WDT was requesting a clock and that was preventing deeper sleep than LPM1 (or maybe LPM0, depending on which clock). That let it
  4. That is exactly what I'm after, I've tried saying LPM4, also the _BIS_SR method, as well as _asm_ (" BIS etc.etc.). This is with +GIE and without it, when I was doing it in assembly I was assembling the word in binary manually. Having slept on it and read your post, your post did remind me that I hadn't tried specifically turning off interrupts. Testing just now if I specifically turn off interrupts (via noInterrupts() or via _BIC_SR(GIE)) it goes to sleep and stays asleep! It stays asleep forever as it's LPM4 and there aren't any interrupts, but this tells me a lot. Something is genera
  5. If my reading of datasheets and energia device files is correct you can solder the optional 32.something kHz crystal onto the launchpad and use that as a clock source for one of the timers to use with PWM. At that point you could have anything down to a 0.5Hz PWM output, I think. Maybe even less if you feed it through a /8 divider first. Low speed PWM shouldn't be an issue. I'm not especially well versed in this business yet, so I may be way off base.
  6. I've had to use external pullups on the TI MCUs I've used i2c on. That's the G2553, LM4, and TM4C129. Doing a pinMode(INPUT_PULLUP) didn't work for me on any of them. External pullups worked great. Right up until something hangs with SDA or SCL LOW or misses a count, at which point it's reset button time. I've been meaning to see if I could fix that. It seemed like it was mostly an issue with the TM4C129 though, so you may not have it. And of course I may have been doing it wrong.
  7. If this forum software supports it, making the Stellarisiti Energia "forum" into a link to 43oh's Energia forum might be the way to go. I too agree that having two forums is a little rough sometimes. I read both and use both classes of chip, so it's not a huge deal, but it's a bit confusing at times. Also agree on putting chip designation in the post title. With this large of a variety it's important to know.
  8. I just got myself a FR5969, so far I'm really enjoying it. I got the RTC going, very entertaining. I got RTC interrupts going, also very entertaining. Now I'm working on sleep mode, I want to use the RTC interrupts to wake up from sleep mode every once in a while, then sleep in LPM3 (or one of the LPMx.5 modes, eventually). I spent longer than I'm willing to admit reading the FR5969 datasheet and setting registers, eventually ending up in assembly. It will not sleep. Here is the basic test code I'm using right now: int counter; void setup() { // put your setup code here, to ru
  9. As a note, I've found that generally "if" is an expensive thing to say if (heh) you're looking at time consumption. Same for "for". Haven't checked "while", but it probably is too. How expensive it is depends on the chip and the variables you're comparing of course. If you're comparing bytes on a 16bit chip that ought to be faster than comparing longs on said 16bit chip, but may not be on a 32bit chip. That said, writing code that doesn't say "if" is a good trick. Oh and I tested the code (modified to work on a launchpad without extra stuff attached) on a scope, and got ~900ms/loo
  10. Update: I downloaded the installer linked by zborgerd. Found its install directory and copied MSP430.dll and HIL.dll to the energia / hardware / tools / msp430 / mspdebug directory, then redid the firmware update process. Success! It works great now. I'll probably write a post on the MCU blog I write for about the update process.
  11. I have one of the Energy Trace FR5969 boards coming, has the updater been updated, or do I need to get the flasher utility linked in the post above this? The board isn't here yet, I just want to be prepared.
  12. I've found that I have COM port issues if I have the serial monitor open when I plug a launchpad in. That's guaranteed failure, like the above. The solution for me is to unplug the launchpad, close the serial monitor, and re-plug the launchpad. That's the only similar thing I've run into.
  13. PD_0 is set as an output and then immediately set as an input, and then has an interrupt attached to it. Shouldn't two different pins be used for input and output, as in the Arduino example? Out of curiosity, where is the input signal coming from, and what does it look like?
  14. Just thought I'd check in here and say THANK YOU! Excellent library, easy to use, easy to set up, etc. I have it working now, sending packets from a g2553 to a Tiva-C, works perfectly. I used the pin map chart Maddox675 posted, as I bought the modules alone rather than with a boosterpack.
  15. That's kind of funny. I gave it a long test too. Created a pull request with the fixed code. Thanks for pointing that out!
  16. Great to see this, I have a couple of those radios headed my way from China right now. Thanks!
  17. The server/client freezing is likely due to an issue I found in the demo sketch that you (and I, and most people I suspect) are pulling the ethernet server stuff out of. The while loop ("while (client.connected())") can only exit if the client sends data. If the client connects but never sends data (FireFox on Windows does this sometimes) it will hang there forever. beyond sending data, it has to send the correct data to make this line return true: "if (c == '\n' && currentLineIsBlank) {", as the break; for the while loop is in there. My soluition was to start a timer when a clien
  18. OK, finally got a chance to sit down and figure out (I think...) GitHub. In theory, there should be a pull request with code that doesn't randomly hang with FF Windows.
  19. Spent some time playing with SPI. It appears that the documentation picture has SPI #1 MISO and MOSI backwards. I swapped the SO and SI connections on the 4142 digipot I have, and it started working. I have not convinced it to read yet, but I'm not positive I'm going about it correctly for this digipot. I checked the 4142 against an Arduino (known MISO/MOSI pins) and SI is definitely SI. I looked at the TM4C129 datasheet to see if it said which was which, and it's an absolute nightmare. Haven't figured it out yet.
  20. On Energia 0101E0012 with a TM4C129 Serial.available() returns the correct number of characters with this test sketch: void setup() { Serial.begin(115200); } void loop(){ if (Serial.available()){ delay(1000); Serial.print(Serial.available()); Serial.print(" characters received. They were: "); while(Serial.available()){ Serial.print(Serial.read()); Serial.print(","); } Serial.println(); } } Does your program/sketch/code/whatver give the serial data enough time to be received? These chips are fast enough that I've found I need to wait for incoming da
  21. I'll certainly try! I Never done anything on github but download, so I'll need to make an account and such. I'll see what I can do.
  22. I don't know if you're still around or not, but I got a IoT launchpad a couple days ago and have been having similar issues with a webserver program based heavily on the demo/example program in Energia (BarometicPressureWebServer), which uses the same core code as in the original post of this thread. With possibly excessive use of Serial and LED debugging, I think I found the problem. If I'm correct, it's due to the while loop. It calls while (client.connected()) { if (client.available()) { and then goes on and does things. The break; statement that ends that while is inside the
  23. Laser+photodiode should work fine, costs more than an LED but other than that there aren't any downsides that come to mind. Putting a black sleeve on the photodiode to keep ambient light out goes a long way towards improving sensitivity when used with an LED. For me anyway, in my admittedly limited experience.
  24. Below is code shamelessly copied from somewhere else on this forum. Some of it (the P2 parts) are related to other things the person was doing. Not sure P1.2 and P1.3 are actually the pins. Test this with nothing but LEDs connected! One of them does one of the Launchpad LEDs. Don't remember which, it's been a bit. This'll get you started anyway, sorry it's not more specific. Energia is nice too (that's where I do my programming actually. You can still do direct port stuff in it), you'll need to set some of it manually though as it defaults to 250Hz (500Hz?) PWM speed. Fish probably won't li
  25. Why not hook 'em to a PWM pin and PWM 'em to off over the course of half an hour? Much more sunsetish I think you'd want the frequency fastish, but I doubt fish's refresh rate is high enough to catch 50kHz flashes.
×
×
  • Create New...