Jump to content
43oh

semicolo

Members
  • Content Count

    137
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by semicolo

  1. Just did some research, you could use the internal voltage reference for a a better accuracy analogReference(INTERNAL2V5) and use 1K/1K for the voltage reference. voltage would be voltage=value/1023*5 You need *5 because the reference is 2.5V but you're using a 1/2 voltage divider (by the way I forgot to take the voltage into account on the post above)
  2. it reads 5V because you didn't use a voltage divider, it means until the voltage dropped below 3.3V the conversion returned 1023 and since you used voltage=value/1024*5, it showed 5
  3. You're lucky you didn't kill the MCU, I'd use resistors with higher values to keep the current below 1mA, for example 1K and 3.3K (with 4.7K voltage is still a bit high to my taste) Then the formula should be voltage=value/1023*3.3 (3.3V because the voltage reference is VCC).
  4. Probably noise, the recommended way to get a sample is to put the cpu in sleep mode and wake up by the conversion interrupt, I don't know if energia is doing that. Also the noise can come from the supply. Did you add a voltage divider for the battery voltage? A fully charged battery is around 4.2V this could damage the MCU.
  5. I mean, the whole goal of using energia/arduino is to not having to play with the registers, else do it in CCS and use the debug feature to find what's wrong.
  6. What about my my code? It just works I don't think you really need the sampling intervals to be spot on accuracy that you need a timer. If you really want it to be better just do // Very simple Arduino Lithium-ion battery capacity tester // from electronicsblog.net #define LED GREEN_LED #define resistor 6.9 float capacity=0, value,voltage,current, time=0; void measure (void) { value= analogRead(0); voltage=value/1024*5.0; current = voltage/resistor; capacity=capacity+current/3600; time++; Serial.print("Voltage= "); Serial.print(voltage); Serial.print("
  7. shouldn't you set p2 to output at the beginning of sendbyte? looks like you set the pins direction at the end but not at the beginning. Nice hack by the way, I'll try to remember it.
  8. For energia constants look into the sources/energia web site/forums
  9. Yes and remove all the timer stuff from setup So something like this // Very simple Arduino Lithium-ion battery capacity tester // from electronicsblog.net #define LED 13 #define resistor 6.9 float capacity=0, value,voltage,current, time=0; void measure (void) { value= analogRead(0); voltage=value/1024*5.0; current = voltage/resistor; capacity=capacity+current/3600; time++; Serial.print("Voltage= "); Serial.print(voltage); Serial.print("V Current= "); Serial.print(current); Serial.print("A Capacity= "); Serial.print(capacity); Serial.print("A
  10. Not sure about this one since I'm quite new to energia myself. But the sole goal of this interrupt routine is to get fixed intervals so you could get away with delays in the loop. Something like: void loop() { measure(); delay(1000); } Plus the rest to control the led. Also unless you're using an external serial adapter, the LP onboard serial converter allows 9600bps maximum.
  11. I did an upgrade from 5.2 to 5.3 yesterday on my win7 pro sp1 64 bits and it went well.
  12. I actually did solder the extra female headers together:
  13. semicolo

    I2C vs. SPI

    I used a 32Mbits AT25DF321A recently to hold 32KHz 8bits samples, output is done with a pwm, there's some audible noise but is good enough for my purpose.
  14. semicolo

    chip selection

    Don't know how it's called in english but ike is right about the frequency, you need to run faster than 5 and 4 times a second, you can't have a once a second task do a 5 times a second task withoug missing. So a 20Hz timer seems right to do 5Hz and 4Hz tasks.
  15. It's easier to just sync IMOO. If you're fairly new to development you'd better stick with official releases though.
  16. Yes maybe a 4pins 2mm header would fit, I don't have that in my inventory though.
  17. What spacing roadrunner84? 0.1" don't fit on LP 1.5, it's slightly larger than 3 pins standard header
  18. this character is just 0xff, set the jumpers like this: Remove anything else, and try some of the communication examples or the echo I provided, if it doesn't work, there's something wrong with your board.
  19. Hi all, this is true on LP 1.5, maybe someone can confirm on older versions. I did a quick search about this on the forums and it doesn't seem to have been mentioned already. TP3 and TP1 near the USB connector allow you to get access to ground and the USB 5V TP3 is ground, TP1 is USB +5V. I soldered pins there on one of my LP for easy cable connection
  20. Forget about this line, wrote something stupid and can't remove it.
  21. Try this to get a hand of the serial monitor void setup() { Serial.begin(9600); } void loop() { if (Serial.available()) { int i=Serial.read(); Serial.write(i); } } It's just a simple echo, whatever you write is sent back.
  22. Strange, sent you a PM with a link to the file on my skydrive.
  23. Do you press enter or click send in the monitor?
×
×
  • Create New...