Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by semicolo

  1. I'm finishing putting together my first 3d printer and attached a pen to make a test: http://youtu.be/t81QYGiyXX4
  2. You're supposed to use registers to access pins, something like: P1DIR = 255-BIT7; // sets Port1.7 as input, other pins as outputs P1OUT = BIT1 + BIT2; // sets Port1.1 and Port1.2 high, other output pins low There are lots of CCS examples on Ti's web site, download some and have a look. You can also use the Grace tool to setup the I/O and peripherals.
  3. It's working on my PC with windows 8, 64 bits and USB3. Usually when the programming interface works, so does the virtual serial device, maybe some drivers issue.
  4. semicolo

    Auduino code

    As far as I know analogRead() doesn't use any interrupt in energia, it just sets the registers and busy waits until the conversion is done.
  5. I'd get the samples directly from a computer, this will give better audio quality and longer play time since you'll be able to store them in flash ,else you're limited to the ram and it's only a few hundred bytes, so a fraction of a second worth of audio. In flash you can have a few seconds depending on the quality. Playing can be done easily via PWM, see my music box project here for some sources: http://forum.43oh.com/topic/3757-yet-another-music-box-simulator/ It's getting the sound from an external flash though.
  6. Do you mean the USB serial port created by the launchpad is assigned COM1 and conflicts with the internal serial port? On my computer it appears as COM4 but it looks like energia doesn't detect ports changes, if I plug the launchpad after I run energia, only the onboard COM1 is shown. Downloading works because it doesn't use the serial port.
  7. Found it! This line is bogus Serial.println (data%1000); It'll display 98 instead of 098. I'll just change the code to display millivolts.
  8. Just tried this with the launchpad connected to a li-ion battery, the accuracy drops a lot when the 1.5V reference is used, I'll try to find why. VCC value:3.103 VCC value:3.103 VCC value:3.98 VCC value:3.103 VCC value:3.93 VCC value:3.98 VCC value:3.93 VCC value:3.98 VCC value:3.93 Instead of finding about 3V, it jumps to 4V, maybe there's a bug in the code.
  9. Jumpers in the hardware serial position? (horizontal on launchpad 1.5)
  10. I was just making a quick test. Something like this should do the same as your code and be easier to read than working with the MSP430 registers: #define ANALOG_HALFVCC_INPUT 11 void setup() { Serial.begin(9600); // msp430g2231 must use 4800 } // returns VCC in millivolts int getVCC() { // start with the 1.5V internal reference analogReference(INTERNAL1V5); int data = analogRead(ANALOG_HALFVCC_INPUT); // if overflow, VCC is > 3V, switch to the 2.5V reference if (data==0x3ff) { analogReference(INTERNAL2V5); data = (int)map(analogRead(ANALOG_HALFVCC_INPUT), 0, 1023,
  11. Well it's possible to generate higher voltages with a dc/dc boost converter for example, I just don't know if it's even possible to embed something like that in a chip without external components and keeping the power usage and costs low.
  12. I have to apologize about writing "but of course you can't use the communication examples." @@Rickta59 pointed out that TimerSerial.h implements a Timer/software driven UART. This works on the g2231 and g2452 and is automatically configure in Serial.h Yes you'd have better luck with TI's Code Composer studio for chips not supported in energia
  13. Makes sense, it'd be hard to generate a 2.5V reference with a 2.4V VCC.
  14. It seems to be working, the following sketch gives me 3.5V with USB VCC void setup() { Serial.begin(9600); // msp430g2231 must use 4800 Serial.println("VCC value:"); analogReference(INTERNAL2V5); } void loop() { long data = map(analogRead(11), 0, 1023, 0, 500); Serial.print (data/100); Serial.print ("."); Serial.println (data%100); // this is wrong if the tens are 0 delay(1000); }
  15. Ok, then as I explained in my first response, it first tries with 1.5V reference to get a better reading, if it overflows it switches to 2.5V reference.
  16. Maybe with analogRead (11), this should set ADC10CTL1 correctly and reset ADC10AE0 completely. Maybe I'll have some time to try it at lunchtime. Maybe there's already a constant for this in energia.
  17. So are you asking why it's using the 1.5V reference and then the 2.5V one? But in fact it's working ok?
  18. It should work, the MSPs are programmed via the Reset and Test pins, but of course you can't use the communication examples. Which ones are you having trouble with?
  19. in fact it looks like it's using old dos style path, if the space is after the 8th character it's ok because the path looks like ENERGI~1 instead of "energia-0101E0009 test" "C:\test 2\energia-0101E0009" doesn't work the error is: Cannot run program "C:\TEST2\ENERGI~1\HARDWARE\TOOLS\MSP430\BIN\msp430-g++": CreateProcess error=2, The system cannot find the file specified It looks like the space was removed.
  20. From the comments, it seems you should use a voltage divider (for example maybe 2 100K resistors), so you have VCC/2 on your analog input. The first try is using the 1.5V internal reference, so it's good for voltage below 3V. If the conversion returns 0x3FF, it means that VCC is >= 3V, so the software switches to the 2.5V reference that allows up to 5V for VCC (but of course you can't go higher than 4V on these chips).
  21. I doesn't seem it's only the spaces because I tried "C:\energia-0101E0009 test" and it seems to work but "C:\Users\pxdoucet\Desktop\dev tools\energia-0101E0009" spits out error 2 Edit: After my second post I checked the path displayed in the error message, in this case it's: "C:\USERS\PXDOUCET\DESKTOP\DEVTOOLS\ENERGI~1\HARDWARE\TOOLS\MSP430\BIN\msp430-g++"
  22. SPI is a synchronous serial protocol. But I just had a quick glance at the datasheets, you don't get the start and stop bits in synchronous mode, so you can't use the hardware as is (you'd have to generate these bits in software, not really useful). It's kinda strange in fact that PS2 needs these bits, you must have them with asynchronous serial but they're useless if you have a clock. Well, sorry for giving you false hope.
  23. I'm not familiar with this exact MCU model, I suppose your best bet to get something close to the MCLK is to setup a PWM on some pin. On the other hand if you're getting the 38400bps rate correctly, the clock must be right. Yes the 430s can do synchronous serial
  24. I asked again about the wiring because this source say you need 4 pins connected as open collector with a resistor to +5V (http://www.computer-engineering.org/ps2protocol/), but it may work with only 2 pins. The protocol looks like standard synchronous serial 8bits data with start and stop bits and odd parity I thought the PS2 communication was done in hardware. From the same page "The Clock line must be continuously high for at least 50 microseconds before the device can begin to transmit its data.", your delay may be doing just that.
  • Create New...