20070429
PIC-PG2C
PIC-PG2C is a simple JDM serial FLASH programmer. It runs directly off the serial port, requiring no external power source. There is some concern it will not work with low power serial ports, such as those found on laptops. I am happy to report however that it works on an IBM Thinkpad T20.
Cheers,
Steve
Labels: electronics
20070428
For those playing at home
It seems some friends of mine keep track of me through my blog... which seems weird in a way, but OK :-) So for those ppl, I currently have chicken pox but is otherwise well.
Cheers,
Steve
Labels: status
20070414
Writing fitting functions for lmfit
double function_name(double, double *);
For example:
double sin_fit(double t, double * p)
{
return p[0] + p[1] * sin ( 2 * M_PI * ( p[2] * t + p[3]));
}
Note that while lm_minimize takes a pointer to an array of parameters, it may not always pass that pointer to the fitting function. Because of this passing fixed parameters to the fitting function using the 3rd argument will yield incorrect results. For example, the following code is wrong:
double wrong_fit(double t, double *p)
{
return p[0]*p[0] + p[1];
}
....
double p[2];
p[0] = 1;
p[1] = magic_number;
...
lm_minimize(..., 1, p, ..., ..., ...., ...);
Here the fitting function wrong_fit relies on a fixed parameter p[1] which it expects to contain the value magic_number. However it will be passed such a p that only p[0] has a valid value and p[1] is undefined. This will lead to incorrect operation.
To work around this, you can use global variables, as follows:
double magic = magic_number;
...
double right_fit(double t, double * p)
{
return p[0]*p[0] + magic;
}
....
double p = 1;
...
lm_minimize(..., 1, &p, ..., ..., ..., ...);
Cheers,
Steve
20070406
PIC Programming under Linux with KIT81
To get KIT81 and its variants working under linux, you need picprg, and configure it as follows:
| Pin | Polarity |
| Vpp | - |
| Vdd | - |
| Clock | + |
| Data out | + |
| Data in | + |
The following screen shot shows what the configuration screen should look like:
Cheers,
Steve
asciigrams
A relative of the emoticon, an asciigram is an upright diagram of a gesture or body language construct using ascii characters.
Currently the following are somewhat popular:
| \o/ | hands in the air |
| \o> | salute |
| <o> | hands behind/above head, surrender |
Cheers, Steve
Defending Others
20070402
CAT
Labels: slashdot