43oh

# semicolo

Members

137

1

1. ## Problem using Arduino code in Energia

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. ## Problem using Arduino code in Energia

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. ## Problem using Arduino code in Energia

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. ## Problem using Arduino code in Energia

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. ## Problem using Arduino code in Energia

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. ## Problem using Arduino code in Energia

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. ## Problem using Arduino code in Energia

Don't forget to use Serial.begin(9600);
8. ## GPIO pin sharing

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.
9. ## Problem using Arduino code in Energia

For energia constants look into the sources/energia web site/forums
10. ## Problem using Arduino code in Energia

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
11. ## Problem using Arduino code in Energia

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.
12. ## Trouble Installing CCS 5.3

I did an upgrade from 5.2 to 5.3 yesterday on my win7 pro sp1 64 bits and it went well.

I actually did solder the extra female headers together:
14. ## 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.
15. ## 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.
16. ## Energia Updating

It's easier to just sync IMOO. If you're fairly new to development you'd better stick with official releases though.
17. ## MIDI Booster Pack

Yes it is eagle
18. ## Get 5V off USB on an MSP430 Launchpad

Yes maybe a 4pins 2mm header would fit, I don't have that in my inventory though.
19. ## Get 5V off USB on an MSP430 Launchpad

What spacing roadrunner84? 0.1" don't fit on LP 1.5, it's slightly larger than 3 pins standard header
20. ## Requesting aid for LaunchPad+EZ430-RF500 Project

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.
21. ## Get 5V off USB on an MSP430 Launchpad

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

23. ## Requesting aid for LaunchPad+EZ430-RF500 Project

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.
24. ## New Energia release 0101E0009 - 12/06/2012

Strange, sent you a PM with a link to the file on my skydrive.
25. ## Requesting aid for LaunchPad+EZ430-RF500 Project

Do you press enter or click send in the monitor?
×
• Blog

• #### Activity

×
• Create New...