Jump to content
43oh

sucotronic

Members
  • Content Count

    10
  • Joined

  • Last visited

  • Days Won

    1
  1. I've written a simple program adapted from the rttl example in the Arduino Tone library. It only need a launchpad, a piezo buzzer and a compiler (in my case mspgcc). You take a look in my blog(I don't want to seem spam, only want to share with others my madness .P). /* Buzzer example */ #include #include typedef unsigned char byte; #define NOTE_B0 31 #define NOTE_C1 33 #define NOTE_CS1 35 #define NOTE_D1 37 #define NOTE_DS1 39 #define NOTE_E1 41 #define NOTE_F1 44 #define NOTE_FS1 46 #define NOTE_G1 49 #define NOTE_GS1 52 #define NOTE_A1 55 #define NOTE_AS1 58 #defin
  2. I would be great if you can pass me the correction, because I haven't foudn any errata in the Bosh website. Well, to test the bmp085 sensor I've it now connected to a Ben Nanonote, and the mini linux machine is doing all the math
  3. Of course, it is also a valid solution, but my main goal is to keep the project simple, and putting another mcu only will serve to consume more power and space in the pcb. Just today I've received a mail from TI saying that the new msp430g chips with 4kb will be shippeg to me 22th of february, so in two week perhaps I can resume the project
  4. All the code combinations produce the same quantity of overflowed compiled code
  5. +1 for using "Bob's your uncle." I love that saying, but don't get to use it much. BTW: @sucotronic: The saying translates to, "the rest is obvious." The main reason to not use the MPX5100AP is easy to understand...it costs the double than the Bosch one! 14$ And the problem with the math is the use of long variables that produces a lot of compiled code. I'm going to wait until TI start sending the new value line chips (but also at the same time will try the pic16f1828, similar price and better characteristics.
  6. I actually use the following command to compile: msp430-gcc -Os -mmcu=msp430x2231 -o i2c.elf i2c.c Using the option -O2 produces larger code, so is better to use -Os. I need to use long variables, because it's specified in the bosch sensor documentation, but perhaps there is a way to do some kind of conversion. Thanks for suggestion.
  7. Doing some changes in the code I've arrived to the conclusion that when compiling the following code: p = b7 < 0x80000000 ? (b7 * 2) / b4 : (b7 / b4) * 2; mspgcc need almost 500 bytes to do the operation. Is this normal?
  8. I'm building a small project with a msp430G2231 and a pressure sensor (bmp085) connected through i2c. I'm also using a snippet of code to output code through serial port. My problem is that the code compiled exceeds the flash size of the uc, but I'm sure there are things that can be optimized. So I'm asking to more expert people about how to optimize it. Thanks in advance i2c.zip
  9. OMG! I should seem the dumbest programmer in the world! xD This kind of problems always drive me crazy when trying to save time copying and pasting code, probably y copy the '=|' from the first assignment because my keyboard I'ts a bit different (I wrote the code in a Ben Nanonote ). Thanks for the typo, now it works okay and it's pretty accurate.
  10. I want to make an easy example about using the Watchdog as interval timer, but when tried the following code I found that I need to put a value of 3200 instead a value of 2000 to get the leds blinking at a 1 second rate. This means that the chip is clocked at 613,281 khz instead of the calibrated 1mhz... or maybe I've forgot to add something? /* Watchdog interval example */ #include #include volatile unsigned int i = 0; int main(void) { WDTCTL = WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1; // Set interval mode, set to zero and interval to 0.5 ms IE1 |= WDTIE; // Enable WDT interrupt BCSCTL1
×
×
  • Create New...