Thread has definitely drifted...... 3V0! rename it to pickit2/3.....
Eric! I still have mine.... good little tool... but!!! pickit2 is much faster.
Eric! I still have mine.... good little tool... but!!! pickit2 is much faster.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Yes, it is a piece of old equipment that has been obsoleted. If someone understood that and wanted it as a collector's item or for its limited usefulness, I would sell it to them. I have no ethical issue with that.
I would not want to sell it to someone who did not understand that limitation.
...
...
Now, if you want to make a reasonable offer, it is all yours.
...
and C is not a high level programming language.
Higher than assembler...
If you are primary an assembly language programmer any language other then assembler is high level. For people fluent in several modern high level language there are shades of grey. Both viewpoints have merit.
Asking the world for an answer in not always the best methodology.
' create an N-point DFT X(k) from x(n). Returns magnitude spectrum
Sub DFT(sn() As Integer, retSk() As Long, N As Long)
Dim e() As Complex ' complex exponentials
Dim Sk As Complex ' our temporary complex DFT
Dim two_pi_on_N As Single
two_pi_on_N = 2.0*(ATan(1)*4)/N ' calculate 2pi/N
Dim i As Long, j As Long, k As Long
' do some precalculations of complex exponential term
ReDim e(0 To N - 1)
For i = 0 To N - 1 ' where i = (kn % N) in the DFT formula
e(i).re = Cos(-i * two_pi_on_N)
e(i).im = Sin(-i * two_pi_on_N)
Next i
For k = 0 To N - 1
Sk.re = 0
Sk.im = 0
For n = 0 To N - 1 ' calculate the complex DFT
Sk.re = Sk.re + sn(n) * e((k*n) % N).re
Sk.im = Sk.im + sn(n) * e((k*n) % N).im
Next n
' convert To magnitude, and store in user's buffer
retSk(i) = Sqrt(Sk.re*Sk.re + Sk.im*Sk.im)
Next k
End Sub
/* create an N-point DFT X(k) from x(n). Returns magnitude spectrum */
void DFT(short sn[], int retSk[], int N)
{
complex e[N]; /* complex exponentials */
complex Sk; /* our temporary complex DFT */
float two_pi_on_N = 2.0*(atan(1)*4)/N; /* calculate 2pi/N */
int i, j, k;
/* do some precalculations of complex exponential term */
for(i = 0; i < N; i++) /* where i = (kn % N) in the DFT formula */
{
e[i].re = cos(-i * two_pi_on_N);
e[i].im = sin(-i * two_pi_on_N);
}
for(k = 0; k < N; k++)
{
Sk.re = 0;
Sk.im = 0;
for(n = 0; n < N; n++) /* calculate the complex DFT */
{
Sk.re += sn[n] * e[(k*n) % N].re;
Sk.im += sn[n] * e[(k*n) % N].im;
}
/* convert to magnitude, and store in user's buffer */
retSk[i] = sqrt(Sk.re*Sk.re + Sk.im*Sk.im);
}
}
Mr. T....Either folks in Finland must be pretty rude or you're the exception. Also, a lot of French people know English and I am sure they would be insulted if they heard you say that. Just like Finnish don't speak English, right? If you don't know about clock cycles and how in highER languages than assembly you can't be sure how many cycles are executed when you write a batch of code, you are the ignorant one. I can't hate the Finnish because I made a lot of money on the Finnish comany Wartsala last year when they bought my website flexicycle dot c o m for their multifuel oceanliner engines. But I didn't have to deal with ignorance...those were the smart ones of the village, obviously.
I don't know why C is considered to be a low level language by anyone. BASIC is universally considered to be a HLL, yet I can write the same program in C using almost identical structure. There's an example following showing the function for calculation of a discrete Fourier transform. So can anyone say that one is high-level and the other is not?
Having the capability to use pointers doesn't make a language 'low level' any more than being able to swing a club makes me a Neanderthal. That said, there are actually pointers available in BASIC using the DEF SEG, VARSEG, VARPTR functions.
The code for DFT in QuickBASIC
Code:' create an N-point DFT X(k) from x(n). Returns magnitude spectrum Sub DFT(sn() As Integer, retSk() As Long, N As Long) Dim e() As Complex ' complex exponentials Dim Sk As Complex ' our temporary complex DFT Dim two_pi_on_N As Single two_pi_on_N = 2.0*(ATan(1)*4)/N ' calculate 2pi/N Dim i As Long, j As Long, k As Long ' do some precalculations of complex exponential term ReDim e(0 To N - 1) For i = 0 To N - 1 ' where i = (kn % N) in the DFT formula e(i).re = Cos(-i * two_pi_on_N) e(i).im = Sin(-i * two_pi_on_N) Next i For k = 0 To N - 1 Sk.re = 0 Sk.im = 0 For n = 0 To N - 1 ' calculate the complex DFT Sk.re = Sk.re + sn(n) * e((k*n) % N).re Sk.im = Sk.im + sn(n) * e((k*n) % N).im Next n ' convert To magnitude, and store in user's buffer retSk(i) = Sqrt(Sk.re*Sk.re + Sk.im*Sk.im) Next k End Sub
The same code in C
Code:/* create an N-point DFT X(k) from x(n). Returns magnitude spectrum */ void DFT(short sn[], int retSk[], int N) { complex e[N]; /* complex exponentials */ complex Sk; /* our temporary complex DFT */ float two_pi_on_N = 2.0*(atan(1)*4)/N; /* calculate 2pi/N */ int i, j, k; /* do some precalculations of complex exponential term */ for(i = 0; i < N; i++) /* where i = (kn % N) in the DFT formula */ { e[i].re = cos(-i * two_pi_on_N); e[i].im = sin(-i * two_pi_on_N); } for(k = 0; k < N; k++) { Sk.re = 0; Sk.im = 0; for(n = 0; n < N; n++) /* calculate the complex DFT */ { Sk.re += sn[n] * e[(k*n) % N].re; Sk.im += sn[n] * e[(k*n) % N].im; } /* convert to magnitude, and store in user's buffer */ retSk[i] = sqrt(Sk.re*Sk.re + Sk.im*Sk.im); } }
typedef struct V_data { // ISR used, mainly for non-atomic mod problems
volatile uint32_t buttonint_count, timerint_count, eeprom_count, highint_count, lowint_count, c1_int, c2_int, hunt_count;
volatile uint32_t pwm4int_count, worker_count, b0, b1, b2, b3, display_count, lcdhits, lcdhits_18tcy, adc_count;
volatile uint32_t clock20, commint_count, status_count, c1rx_int;
volatile uint8_t blink, buzzertime, voice1time, voice2time, qei_counts;
} V_data;
struct V_data V;
#define LEDS LATC
void blink_led(uint8_t led, uint8_t start) // blink and store status of 4 leds
{
if (led > 3) return;
if (start) {
V.blink |= ((LEDS >> led)&0b00000001) << (led + 4); // read the state of the LED on the LATCH and store it on [4..7] of blink
V.blink |= 0b00000001 << led; // set the blink bit for the LED
} else {
V.blink &= ~(0b00000001 << led); // reset the blink bit for the LED
LEDS &= ~(0b00000001 << led); // reset the LEDS bit for the LED
LEDS |= (((V.blink >> (led + 4))&0b00000001) << led); // set the LEDS bit
}
}
C/C++/C#/Matlab - they're much the same to me, though C is the least productive, and C# the most. C#, to me, has the most advanced environment to work in out of those mentioned. Matlab is great for uni for any problem that can be vectorised, but is horribly slow for code utilising nested loops; that's when embedding C++ libraries is handy, though I'd prefer they just improved Matlab to be able to handle such cases.People that class C as a low level language are used to Matlab and Python (with numPy and SciPy), such people would not even contemplate writing an DFT/FFT as its comes in a default library. Matlab and Python with ... also have methods to remove most for loops.
If you would list programming languages from low-level to high-level, C would come right after Assembly. I can't think one single programming language that is more low-level than C, but higher than Assembly. So, how can somebody call C a high level language?