Monday, November 21, 2011

Patrick Rothfuss is class

The Name of the Wind is a wonderful book. The video below is also wonderful.



The guinea pig is a fish.

What did they eat?

Have you ever wondered what the Italians ate before pasta (from China) and tomatoes (new world)? The Chinese dictionary that I have (1970s PRC, so you know, they had opinions) say that tomatoes and corn (new world) are from China.

I think that it would be fun to have regional dinners circa 1000AD.

Tuesday, November 8, 2011

やさしく歌って

I am no Roberta Flack, but I think that my next KARAOKE session will include this:

Monday, November 7, 2011

I passed the 2nd amendment test, and the US citizenship test.

I got 11/12 on this 2nd amendment issue test. This made me read the Japanese Constitution and American one. The EU constitution was too daunting, at 1800 pages.
The Japanese and American documents have their strength in that one can read the documents. I am very much against complexity in general, and I am opposed to large government very much for that reason, but Article 26 of the Japanese document is good for society.

Here is the quote:
第26条 すべて国民は、法律の定めるところにより、その能力に応じて、ひとしく教育を受ける権利を有する。
2 すべて国民は、法律の定めるところにより、その保護する子女に普通教育を受けさせる義務を負ふ。義務教育は、これを無償とする。

I am not sure of the history of this article:
23条 学問の自由は、これを保障する。
...but I guess that is required when you do not have freedom of speech.

Saturday, November 5, 2011

Technical documentation is a guideline.

I have been using an Analog Devices ADC for a project. It's an AD7685, 16-bit with SPI. It works with a SPI bus, but not unless you have a SPI master that is more flexible than pretty much anything that I have ever seen. One cannot just attach the device and have the SPI bus communicate. The chip select line controls the conversion, and the MOSI line controls the 'mode behavior'. The /CS line needs to be double dipped, and because the device has an internal clock, it seems to be very picky about the timing.

I've modified Figure 35 for the datasheet. Have you ever seen a /CS line with this behavior? The other thing is that the image suggests that the /CS line can be unasserted after the initial rising edge that starts the conversion.


Here's the reality of functionality. The datasheet states that there needs to be minimum of 3.2uS between the rising edge on /CS and the data to be valid to be clocked out. I can tell you that they are absolutely correct, and the device is finicky about this timing. If you happen to get leading '1's in your data value, you have violated this setup time. If you reach 10uS between /CS and clocking, I also received incorrect sample data on the bus.

I was trying to be smart and get this double-dip /CS from the previous SPI request or in some other way, but because MOSI needs to be '1' when /CS goes low, you basically need to dedicate this bus time exclusively to this IC. Considering that this setup time takes as long as the total data transfer, it is very disappointing.

In summary, the failure mode of violating SPI (which this barely qualifies) timing is the MSB being '1's of your data sample and you will need to bit bang the SPI unless you are lucky enough to have control over the logic in your SPI controller.

Thursday, November 3, 2011

Poor choices.

Wardrobe consultants, Colourist, Hair Consultant.... those are the poor choices that I have been exposed to this week. Three days on the bus, three different woman with children who are under 25, who are not making it. One of the interesting things about Americans is that they like to talk, whereas the English cling to their privacy.

I have never felt that I owed anyone a thing, nor have I expected to be owed something. Those 3 women are the best argument against democracy that I've met recently. They want what I have, but they do not want to work for it, and they are unable to understand that their choices have put them where they are.

It reminds me of a line from Trainspotting.
Rent-boy: Choose Life. Choose a job. Choose a career. Choose a family. Choose a fucking big television, choose washing machines, cars, compact disc players and electrical tin openers. Choose good health, low cholesterol, and dental insurance. Choose fixed interest mortgage repayments. Choose a starter home. Choose your friends. Choose leisurewear and matching luggage. Choose a three-piece suit on hire purchase in a range of fucking fabrics. Choose DIY and wondering who the fuck you are on Sunday morning. Choose sitting on that couch watching mind-numbing, spirit-crushing game shows, stuffing fucking junk food into your mouth. Choose rotting away at the end of it all, pissing your last in a miserable home, nothing more than an embarrassment to the selfish, fucked up brats you spawned to replace yourselves. Choose your future. Choose life... But why would I want to do a thing like that? I chose not to choose life. I chose somethin' else. And the reasons? There are no reasons. Who needs reasons when you've got heroin?

Wednesday, November 2, 2011

macports and arm-elf-binutils

port install arm-elf-binutils
It threw a few shoes on MacOS 10.7. For some reason, on 10.6, the binaries that were build had PowerPC code.
The solution is to install gcc45, and then update the compiler flags in the portfile.
The resulting Portfile for arm-elf-binutils has the following directives:

depends_lib port:gettext
configure.cppflags -I${prefix}/include
universal_variant yes
configure.compiler macports-gcc-4.5

Someone should make me the maintainer of these...