Scratch Built Altimeter: Parts

The Rocketry Forum

Help Support The Rocketry Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Originally posted by darkhelmet
I just designed a board that can average 10 14-bit samples in 30 usecs. It uses the TI 8-ch TLC3548. The processor is a TI tms320c6720 running at 350MHz, and does 2 Billion Floating point operations per second.

I'm not bragging though. ;)

I have a board that can do that in just 3usec. The processor is an Intel Pentium 4 running at 3GHz. It might be hard to fit in a rocket, so I could use my board with a 2.2GHz Intel Celeron. The whole thing (with 15" color LCD and battery) weighs just 8lbs!

:)
 
Originally posted by m85476585
I have a board that can do that in just 3usec. The processor is an Intel Pentium 4 running at 3GHz. It might be hard to fit in a rocket, so I could use my board with a 2.2GHz Intel Celeron. The whole thing (with 15" color LCD and battery) weighs just 8lbs!

:)

lol, and that 3us was probably the time it took the pixel to refresh :p
 
Originally posted by m85476585
I have a board that can do that in just 3usec. The processor is an Intel Pentium 4 running at 3GHz. It might be hard to fit in a rocket, so I could use my board with a 2.2GHz Intel Celeron. The whole thing (with 15" color LCD and battery) weighs just 8lbs!

:)

Your PC has an A-to-D that can do 10 14-bit samples in 3usec? PC's usually have a slow stereo audio digitizer.

Uh, and you can't do 2G FLOPS on a 3GHz Pentium 4. A dedicated TI DSP at 350MHz beats it and runs at a fraction of the power. Plus it's about 3/4" square. :)

However, I do know somebody that put a PC Motherboard in a 6" dia rocket! Why? 'Cause he could. ;)
 
Originally posted by basil4j
If the CPU is running at 1Mhz, then one clock cycle would take 1/1000000 = 0.0001ms

1389 clock cycles x 0.0001ms = 0.1389ms to perform samples

:)

Hmmm. Check your decimal point. 1usec is 0.001msec. So, that's 1389usecs or 1.389msec.

Also, depending on the processor, that 1MHz oscillator may be divided down further to get the processor clock count you're reading.

A sure-fire way to time a code sequence is to toggle an I/O pin on before the code and off after the code. Then look at the pulse width on an oscilloscope. For real-time software with interrupts running, this can be quite revealing with a multitrace scope and several pins being toggled.
 
Originally posted by darkhelmet
Hmmm. Check your decimal point. 1usec is 0.001msec. So, that's 1389usecs or 1.389msec.

Bah, i always go wrong below 1 second lol Thanks :)

Originally posted by darkhelmet
A sure-fire way to time a code sequence is to toggle an I/O pin on before the code and off after the code. Then look at the pulse width on an oscilloscope. For real-time software with interrupts running, this can be quite revealing with a multitrace scope and several pins being toggled.

I don't have an scope, so I just output the clock values to a TV screen or whatever using a separate cog (or core, im using an 8 core MCU)

:) The scope things a good idea though! And so simple!
 
Originally posted by darkhelmet
Your PC has an A-to-D that can do 10 14-bit samples in 3usec? PC's usually have a slow stereo audio digitizer.

Uh, and you can't do 2G FLOPS on a 3GHz Pentium 4. A dedicated TI DSP at 350MHz beats it and runs at a fraction of the power. Plus it's about 3/4" square. :)

However, I do know somebody that put a PC Motherboard in a 6" dia rocket! Why? 'Cause he could. ;)

No, but it could probably average the smaples that fast. According to Wikipedia a P4 can do about 10 GFLOPS (I can't find any actual numbers for diferent P4s and different clock speeds). Maybe I can get my GPU to do some of the calculation.

It was a joke. A processor designed for this will obviously be a lot better than a general purpose PC (especially if it has to fit in a rocket).
 
Originally posted by m85476585
It was a joke. A processor designed for this will obviously be a lot better than a general purpose PC (especially if it has to fit in a rocket).

And especially if you need a realtime OS. Can't click that "exception violation" alert box unless somebody's onboard. ;)
 
Okay... I got all my parts and everything :), but it seems like my LCD takes up too much power. Instead, I'm going to use the standard "beeper" reporting method. What is the best way to turn a number into beeps? Is there an algorithm? I'm using a Basic Stamp 1 controller....
Thanks!
 
This isn't BASIC, but you can probably translate it.
<del>
Code:
for (int i = 5; i>0;i--){
     if ((int)altitude/(10*i) == 0){
             beep(10);
     }else{
          beep((int)altitude/(10*i));
     }
}

void beep(int b){
     for(int i = 0; i< b; i++){
            ***code to make beep and a pause goes here***
     }
}
</del>
EDIT: This code didn't work.
 
Originally posted by m85476585
This isn't BASIC, but you can probably translate it.

Code:
for (int i = 5; i>0;i--){
     if ((int)altitude/(10*i) == 0){
             beep(10);
     }else{
          beep((int)altitude/(10*i));
     }
}

void beep(int b){
     for(int i = 0; i< b; i++){
            ***code to make beep and a pause goes here***
     }
}

Are you sure this code works?
If the alt. is 850ft, then the loop would call beep(17), then beep(21), then beep(28), then beep(42), and then beep (85).
It doesn't make sense to me :(
 
It should be 10^i, or something like Math.pow(10, i). I also changed the > to >=.

Code:
for (int i = 5; i>=0;i--){
     if ((int)altitude/(Math.pow(10, i)) == 0){
             beep(10);
     }else{
          beep((int)altitude/(Math.pow(10, i));
     }
     pause(***time between a set of beeps***);
}

void beep(int b){
     for(int i = 0; i < b; i++){
            ***code to make beep and a short pause goes here***
     }
}
 
One of the alts out there (I forget which one) claims to have patented the system of using a long beep for the 1000's place, a medium beep for the hundreds place, and a short beep for the 10s place. I just checked the Perfectflite site and I didn't see it there (though it beeps out the altitude) If you ever want to sell this alt, you may want to avoid the issue by doing something like using combinations of different tones. I'm not a lawyer, but I think it's o.k. do use the patented method if you're not selling it.
 
You could have it do the beeps in binary. Short beep = 0, long beep = 1. It would be a little more work to convert it to a decimal number, but you wouldn't have to listen as long to get the altitude. With just 17 beeps you could get a number as high as 2^17, or 131,072 feet. To beep out 100,000 in decimal would take 51 beeps (worst-case because a 0 = 10 beeps). With just a few more beeps in binary you could have a maximum altitude of over a lightyear! (2^55 feet = 1.16077843 lightyears).

Alternatively you could use a long beep for 0 instead of 10 beeps.
 
Here's how I do it in assembly. I do it with LEDs instead of beepers, though.

mov temp,altitude
loop1:
. cpi temp,1000
. brlo loop2
. subi temp,1000
. rcall longbeep
. rjmp loop1
loop2:
. cpi temp,100
. brlo loop3
. subi temp,100
. rcall mediumbeep
. rjmp loop2
loop3:
. cpi temp,10
. brlo loop4
. subi temp,10
. rcall shortbeep
. rjmp loop3
loop4:

etc....
 
Back
Top