New Products Flash Sale
Jack Crossfire's blog View Details
Posted by Jack Crossfire | Apr 06, 2015 @ 02:43 AM | 2,792 Views

The construction is endless. Endless highrises as far as the eye can see are going up. The Yellen said let there be credit & at once there was infinite credit. It's the largest credit boom in all history, infinitely larger than 2007, infinitely larger than 1999. Dow 18,000 was just a dream when it hit 10,000 just 5 years ago & now 40,000 is just around the corner.

Rent here is now the highest in the world. $6000, $7000, $8000 & it rises every week. You can more cheaply build an apartment out stacks of money than make the amount of money required to rent it. The Yellen decreed without total employment, the money would continue to flow, forever.

Overnight, software became the new english. Almost every conceivable task now requires writing software, but instead of the software jobs spreading out to the industries that use them, the industries chased the software jobs to SOMA. Business minds have decreed software can only be written in SOMA, by formally trained programmers with Stanford degrees.

Every conceivable product is now being developed in SOMA. Food, medicine, clothing, pet furniture, mortgages, health insurance, payment schemes, cars, shoes, farms, movies, artwork, spaceships, everything that was once created in an entire country now requires software & can only be done in SOMA.

It's horribly inefficient, but up is the new down with infinite credit. Stanford graduates live in a different universe, now making over $400,000 their 1st year after college. That different universe is rapidly becoming the baseline to stay here. The time is nearing when those of us who can't keep up with the rent are going to have to move out. There's probably 2 more years left at 2010 era salaries, but if anything necessitates going back to school, it's going to be the rising cost of living forcing us to look to bigger companies which can afford $400,000 & who need the Stanford degree more than experience.
Posted by Jack Crossfire | Apr 04, 2015 @ 12:58 AM | 3,021 Views
Took the path following gear off the truck. It was decided that it was too unstable & too fast for the rate of the machine vision algorithm. The hot weather was making daylight drives rare. Getting the test footage that proved the algorithm required lots of manual steering. A slow machine vision autopilot would need to be nearly perfectly on target from the beginning, to have a chance.

The combination of sonar & compass once again emerges as a leading idea. It needs another microcontroller. The initial design keeps a constant heading with the athlete directly behind. The next design keeps a constant heading with the athlete a fixed distance beside.
Posted by Jack Crossfire | Apr 02, 2015 @ 01:01 AM | 3,498 Views
Playing 4k video in Linux is a big deal. The days of software playback are decidedly over. The XVMC interface was the 1st method of hardware decoding. In 2007, it was replaced by the VAAPI interface in Intel cards & VDPAU interface in NVidia cards. Support varies from card to card.

Integrating hardware decoding in an editing program requires intimately dissecting each codec, replacing the specific functions the card supports with hardware calls. The mane codecs to support would be H.264 & JPEG. It's still in the realm of purpose built demos, nothing that could reach a wide user base.

Suppose you had hardware decoding in an editing program. What would you watch in 4k? The format most often viewed is still 640x360. Only rarely is it ever worth downloading something in 720p. The bandwidth to download 720p is now $110/month & rising daily.

The old timers were on to something when they designed the 1st TV resolution, in the 1930's. Motion blur & compression artifacts make most scenes look like 640x360.

It's a lot different than the serious cinema going days of 1999. Most movies are watched on phone screens, in a window, 15 minutes at a time. No-one shuts down for 2 hours to do nothing in front of a big screen, except for single women. They're always shut down.

4k is useful for archives. Probably in the next 10 years, everything is going to start as 4k. Today's 1920x1440 starting footage is still reduced to 1280x720 to make stabilization...Continue Reading
Posted by Jack Crossfire | Mar 30, 2015 @ 12:52 AM | 2,821 Views
So the very last attempt before going to sleep got GPS to go again. Some
years ago, Google dropped support for the LocationManager & switched to the
FusedLocationApi, which was far more complex. The general idea is in this
incomplete Main class:

public class Main implements 
	public GoogleApiClient mGoogleApiClient;

// start GPS
	void init()
                mGoogleApiClient = new GoogleApiClient.Builder(this)


// get location immediately
	void polling()
				Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);

// manually stop GPS
	void close()

// callbacks from the location API
	public void onConnected(Bundle connectionHint) {
// Only getting 1hz
        final int locationInterval = 1000;

        LocationRequest mLocationRequest=new LocationRequest();


	public void onGpsStatusChanged(int event) {

// callback when location is ready.  This is more efficient than polling, but 
// doesn't happen at a known time
	public void onLocationChanged(Location location) {

Another step backward & another step forward. If anyone can make a serial
port require 2 API's & 10 million lines of code, it's the Goog.
Posted by Jack Crossfire | Mar 28, 2015 @ 11:45 PM | 2,941 Views
After several uneventful years, Android GPS stopped working again. The problem initially appeared to be a failure of the app to stay on when the phone was blank. Then it was narrowed down to the GPS module shutting down when the phone was blank. It was further narrowed down to not involving the SDK, IDE, or any settings.

It was further narrowed down to the module not shutting down but entering a mode where it continued reporting locations, but much less accurately when the screen was blank. Each location was very close to the final real location, but slightly moved towards the current location.

The issue 1st appeared after running 13 miles with it. After leaving a Target store, it stopped recording the current position when the screen went blank. The issue now appears like 1 of those cases of putting your thumb on a trace to make a circuit work. In this case, the proverbial thumb would be the screen being on.

The timing of it all agrees with yet another salt water intrusion. These phones are now $30, so there wasn't much concern for protecting it. They're cheaper than buying a standalone GPS module. GPS recording still works with the old battery sucking, unreliable bluetooth hack:

There's another matching phone at the day job that no-one uses, but success varies when changing phones with the same plan.

The innards continue on their way down to a single chip on board.

A contact covered in goo being used to enhance connectivity, but no salt. Wiped the goo off, which did nothing. There were many pads for missing components, near all the antennas.

The other side was a bare sheet of nothing.
Posted by Jack Crossfire | Mar 27, 2015 @ 12:00 AM | 2,604 Views
In what has become an annual ritual, Wednesday was pilot suicide day. Now that Egyptian, Malaysian, & German pilots have killed themselves by crashing their planes, the question is who will kill himself next year?

Easy enough to say humans should be taken out of the loop & there shouldn't be a crew of any kind, but it's yet another case of humans now being unfit to do something they did successfully, 50 years ago, like marriage & politics.

Hard to say there are any more people with mental health issues on the street, than 30 years ago. There could be a zombie invasion.
Posted by Jack Crossfire | Mar 19, 2015 @ 11:39 PM | 3,848 Views
Are you finding millenials to speak a completely unintelligible language?

"On CSI: Cyber, Uber Is the Perfect Vehicle for Dad Sadness Murder"
"The Government Is Testing Myriad Invasive Biometric Surveillance Methods"
"Tag Heuer and Intel Are to Challenge the Apple Watch"
"Mall Cops Catfished Black Lives Matter Activists on Facebook"
Posted by Jack Crossfire | Mar 19, 2015 @ 01:14 AM | 3,063 Views

The next generation of travel fan was finished. While many ideas for a shroud emerged, it still ended up the same as last year. The tripod mounting was much smaller than last year. The maximum power was reduced to 1/4, to make it suitable for indoor use.

The best idea for a shroud would not fit in a suitcase, but be suitable near a pool.
Posted by Jack Crossfire | Mar 16, 2015 @ 11:58 PM | 3,610 Views

Motor Noise comparison (0 min 46 sec)

3 ESCs were compared to find the least noise. None were as silent as a household fan, but SimonK at 18khz was the quietest.

After debating the issue all day, decided to go with the original plan of installing SimonK firmware.

An hour of intricate soldering attached a programming header directly to the Atmega8 SCK, MOSI, MISO, RESET. It had the same pinout as the Atmega328. This was a SuperSimple 15-18A from 2007, predating Arduino by many years. Atmel had yet to even label it as an Atmega.

The firmware was on

Making the particular image required make tp.hex. There was also a tp_8khz.hex target, which generated 8khz PWM. tp.hex generated 18khz PWM. Installation used the Arduino as ISP sketch, using:

/amazon/root/arduino.heroine/hardware/tools/avr/bin/avrdude -C/amazon/root/arduino.heroine/hardware/tools/avr/etc/avrdude.conf -v -patmega8 -cstk500v1 -P/dev/ttyACM0 -b19200 -Uflash:w:tp.hex:i -Ulock:w:0x0F:m

The motor was now quieter than all the others, even at 19V. 19V at minimum throttle previously made the loudest squeel. There was still a slight wine from commutation, but the squeel was gone. It was quieter than the Castle Creation 35, which was rated at 32khz. The Castle still squeeled at 32khz, probably due to a bug.

There was a nugget on about the tp.hex image containing a bootloader, but it required some fuse mangling & yet another Arduino sketch.
Posted by Jack Crossfire | Mar 15, 2015 @ 03:55 AM | 4,673 Views
For all the 3D printers which you absolutely must buy, there is but 1 printer which has never improved or gone anywhere but up in price: the kind which prints on paper. More specifically, the 44" inkjet. They were $3000, 10 years ago. Now, they're $5000. To this day, they still dry out if not used every week. The refills cost hundreds in the old days & thousands now.

With all the advances in technology that we're told are packed into the 3D printer, absolutely none of it has benefited the inkjet. Hacks of inkjets only amount to reusing the x-y table, making the print head squirt something besides ink, but never expanding the form factor. There is still no consumer offering which can print on 44" paper & no-one has ever hacked an inkjet to do it.

Your best bet is based on a plotter, but it would be glacially slow at printing anything near photo quality, if it ever did. It takes very high resolution to achieve any kind of color gradient.

The Goog found some guy who built a 1 pin dot matrix printer, years ago. We seemed to have common interests, over the years. It's amazing how primitive everything in the 1980's looks today. In the mind's eye, the 1980's look as new as today.
Posted by Jack Crossfire | Mar 14, 2015 @ 03:54 AM | 3,516 Views
Built a simple test board for a 2nd ATmega & it worked perfectly. The Arduino ISP sketch required no changes. Getting the bootloader to work was the last straw. Many configuration parameters were missing from boards.txt.

Getting the required reset pin required pulling out the ATmega from the UNO & using the UNO as a serial port. Would never write a bootloader which required connecting the reset pin. This required a 2nd ribbon cable, different from the cable used to program the bootloader. The bootloader ended up not being worth it.

Found the verbose options in the Arduino preferences, which would reveal how to do everything on the command line. Made up a makefile which could compile an old time C program, upload it using Arduino as ISP, set the fuse bits & everything.
/amazon/root/arduino.heroine/hardware/tools/avr/bin/avr-gcc -O2 -mmcu=atmega328p -o fan3.o fan3.c

/amazon/root/arduino.heroine/hardware/tools/avr/bin/avr-gcc -O2 -mmcu=atmega328p -Wl,--section-start=.text=0x0000 -nostdlib -o fan3.elf fan3.o

/amazon/root/arduino.heroine/hardware/tools/avr/bin/avr-objcopy -j .text -j .data -O ihex fan3.elf fan3.hex

/amazon/root/arduino.heroine/hardware/tools/avr/bin/avrdude -C/amazon/root/arduino.heroine/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -P/dev/ttyACM0 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xE2:m
/amazon/root/arduino.heroine/hardware/tools/avr/bin/avrdude -C/amazon/root/
...Continue Reading
Posted by Jack Crossfire | Mar 10, 2015 @ 12:38 AM | 4,007 Views
2 weeks ago, an apartment in the city was $5000. Now, it's $7000. 5 years ago, the stock market was 10,000. Now, it's 20,000. Last year, a house in Palo Alto was $1,000,000. Now, it's $4,000,000. From this standpoint, $15,000 is not a lot of money.

Though a meaningless amount, the $15,000 tag should keep it out of competition with the thousands of fitness tracking startups. There's still at least 1 guy whose home equity isn't doubling every second & who still needs to pick $200 over $15,000.

From half an hour scrolling through long & informationless web pages of computer renderings of nothing, it's clear their market is men buying status symbols for their girlfriends. That segment is a lot more alive now than it was 20 years ago. But say you just sold your $5,000,000 condo. Why not drop a day worth of property tax on a $15,000 watch?

It's also clear the middle class is pulling away from the rest of us. The top 1% is the new middle class. That's what the 1st $1000 phones felt like, when they arrived years ago.
Posted by Jack Crossfire | Mar 08, 2015 @ 11:45 PM | 3,541 Views

A week of commutes yielded the standalone Atmega board, but it didn't take a program. The Arduino ISP generated all the right signals, sending 0xac 0x53 0x00 0x00 to enter programming mode, but the Atmega stood silent.

Getting this far was a bit harder than the marketing. 1st, most Arduino UNO's end up in a drawer, never to be seen again. The remaneder get used in a project which is never finished or turned on once & put away. Almost never is a project converted to a standalone board.

There is the standard guide

Since every version of the Arduino IDE is different, the guide is almost useless. The file needed to be decompressed directly into the arduino-1.6.0/hardware directory. Then the hardware/breadboard/avr/boards.txt file needed a very cryptic line:


Flashing a bootloader would 1st require installing the examples->ArduinoISP sketch on the UNO. That required having "Arduino UNO" as the board, "ArduinoISP" as the programmer. Open the serial monitor, set baud rate 19200 & send 1[space] to verify the ArduinoISP is running.

Then change the programmer to "Arduino as ISP" change the board to "Atmega 328 on a breadboard" & select tools->"burn bootloader". That invoked the ArduinoISP sketch properly. It generated all the right signals, but the target Atmega didn't send anything on MISO or even put it in output mode.

Tried slowing down the ArduinoISP to 32khz by changing CLKPR, increasing the delays to 1 second in start_pmode, connecting all the GND & Vcc on the target. It was still dead.

The next step would be making an Atmega breakout board just for programming the qfp32 package, with room for trying a crystal & serial port. Using a tried & true PIC or stm32 is a lot more productive than starting a new microcontroller.
Posted by Jack Crossfire | Mar 04, 2015 @ 12:05 AM | 3,695 Views
Posted by Jack Crossfire | Feb 28, 2015 @ 05:59 PM | 3,603 Views
It's 10 years late in the making, but now the Arduino nuggets not available anywhere else because no-one talks about the flaws in their own investment or they just don't know. The ATMega328 has a lot of performance not available in the default Arduino load.

The Arduino sketch is preprocessed into a C++ source file of some kind, which is linked into a main program in hardware/arduino/avr/cores/arduino. There are convenience macros named sbi in the main program but named setBit in the sketch.

The Arduino IDE runs a bunch of commands to preprocess, compile & flash your program. It would be easier to run a makefile from the command line, but there's no easy way to extract the commands from the IDE. Running a program requires uploading then clicking through to enable the serial monitor every time. The serial monitor resets it again.

There is no bit toggling opcode like there is on a PIC18. Toggle a bit with

bitWrite(PORTD, 2, !bitRead(PIND, 2));

Any project is going to finish as a standalone ATMega using its internal oscillator. The Arduino UNO is fixed to use a 16Mhz crystal & doesn't allow changing the clock source to the internal oscillator. This requires building up a 2nd board, using the UNO board to write a bootloader on the 2nd board. The clock source can only be set with the UNO board programmed with an ArduinoISP sketch.

Fortunately, the internal oscillator's 8Mhz speed can be simulated by setting the CLKPR register.

CLKPR = (1...Continue Reading
Posted by Jack Crossfire | Feb 21, 2015 @ 02:55 AM | 4,900 Views

10 years after everyone else, it was finally time to get the Arduino going. It was decided that a totally silent fan can be made, using the motor in stepper mode, driving a continuous sine wave on all 3 phases. It wouldn't be very efficient, but it would be guaranteed to work.

The atmega328 has a huge number of PWMs, enough to drive 6 MOSFETs independently. Getting this number of PWMs requires locking them to the CPU clockspeed, so the CPU clockspeed needs to be adjusted. Completely independent frequency would reduce the number to 3 PWMs.

At 16Mhz, PWM goes at 64khz. Using the 8Mhz internal oscillator, PWM goes at 32khz. The clockspeed can be adjusted in powers of 2 & would have to be 8Mhz or below. Changing the PWM frequency also breaks all the features of the Arduino libraries, since they use the timers for other functions.

The rest of the required functionality is standard for microcontrollers, an ADC to control speed, an ADC to detect stalls.

The mane problem is the arduino IDE offers little to program a bare atmega in a circuit. The IDE can't program an atmega without a bootloader. It requires connecting the bare atmega's SPI pins, programing the Uno's atmega to program a bootloader into the bare atmega, then connecting the bare atmega's UART pins, removing the atmega on the Uno to program a main program on the bare atmega. This has to be repeated for every bare atmega.

The IDE also can't write a new bootloader on the Uno's atmega. That requires buying yet another programmer & connecting it to the ICSP header on the UNO.

The IDE & Arduino libraries have more likely served their purpose in bringing up a PWM test program. The UNO has to be reprogrammed for programming bootloaders in bare atmegas. The bootloader source has to be modified to be a main program.
Posted by Jack Crossfire | Feb 15, 2015 @ 08:37 PM | 4,023 Views

A very brief test of path following was a complete failure. Machine vision did the business, but feedback was either too fast or too slow, never able to stay on the path. Maybe the machine vision was too slow. Line following robots have done this forever, but using very fast sensors.

Maybe the feedback needed low limits. Maybe instead of continually adding an offset to the heading, it needed to add offset once when the path veered 1 way & not again until the path veered the other way. Maybe the rate of change in the path is needed.

It's much more complicated than expected, for something that's just supposed to trim steering.

Anyways, either the battery was defective, never charged, or the PI sucked a lot more power than expected, but the battery went to 8.4V & the pi died. Then the 433Mhz died. It looked like a conformal coating issue. Managed to drive it home using the phone. There were signs the phone could have the same 1 handed interface as the stick & the phone could be reasonably water resistant.
Posted by Jack Crossfire | Feb 15, 2015 @ 02:02 AM | 3,703 Views
Posted by Jack Crossfire | Feb 13, 2015 @ 12:15 AM | 3,253 Views
After a sleepless night of using the travel fan, it obviously needed to be completely silent. PWM would never do. An ESC like none other needed to be built. It needed to use linear voltage control. It was finally a practical reason for the lifelong dream of building an ESC from scratch.

It needed to run on linear voltage down to 1V. It would be fed by a 6V BEC with some way of adjusting voltage without PWM. It would need all N MOSFETS, because the high voltage wouldn't be high enough to turn on a P.

There was technical appeal in making it out of BJT's. It would be the only one of its kind. There's a massive supply of BJT's in the apartment. They would take some voltage drop off the regulator. But to be a travel fan, it needed to be compact, so MOSFETs won out. There was still a massive supply of MOSFETs from the days of trying to launch spaceships with magnets & burning them up instead.

The 1st attempt was a through hole failure. It used P MOSFETS which would't turn on because the high voltage was too low. A more complicated circuit with N MOSFETS, a full boost converter, high side BJTs would be required.

...Continue Reading
Posted by Jack Crossfire | Feb 08, 2015 @ 08:32 PM | 3,891 Views

After a month of commuting, a new electronics package was fabricated. The $5 Turnigy BEC was put to use. It was a piece of garbage that melted at 2A. The high energy BEC business is a mercenary business. They only contain a few dollars of parts, but digikey has a $25 minimum. Castle creations remanes the only supplier of a functioning high energy BEC, still charging $25 after 10 years.

A rising edge interrupt handler allows any pin on the STM32 to be used as an SPI bus, at reasonable bitrates. Piecing together forum dialogs revealed a way to access hardware SPI on the raspberry. There was a workable test program on by the name of spidev_test.c

There was never an organized way to stuff the truck.

...Continue Reading