April News

Dog in dreamland
Cat eyes

Every night I have the same dream
I'm hatching some plot, scheming some scheme

   No Line On The Horizon, track 1 — No Line On The Horizon album, 2009.
By U2, Lyrics at U2.com/discography


Software Development

Keyboard
Pounce Kwikstix LCD

Freescale KwikStix board with K40 processor, showing LCD with all segments enabled.

K40 today, K64 tomorrow

Freescale KwikStix with some “cut-and-paste” to show our plans for world domination.


The original example to turn on all segments:

						
void _SLCDModule_TurnOnAllSegments(void)
{
  LCD_WF3TO0   = 0xFFFFFF00;
  LCD_WF7TO4   = 0xFFFFFFFF;
  LCD_WF11TO8  = 0xFFFFFFFF;
  LCD_WF15TO12 = 0xFFFFFFFF;
  LCD_WF19TO16 = 0xFFFFFFFF;
  LCD_WF23TO20 = 0xFFFFFFFF;
  LCD_WF27TO24 = 0xFFFFFFFF;
  LCD_WF31TO28 = 0xFFFFFFFF;
  LCD_WF35TO32 = 0xFFFFFFFF;
  LCD_WF39TO36 = 0xFFFFFFFF;
}
						
					

Our version to turn on all segments:

						
#define LCD_BYTE_START	((unsigned char *)(0x400be021))
// LCD_WF3TO0 + 1) to skip first byte

void  set_lcd_all_segments(void) {
        int i;
  	unsigned char *ptr;

	ptr = LCD_BYTE_START;
	for (i = 1; i <= 39; i++) {
		*ptr++ = (unsigned char)0xff;
	}
}
						
					

After we bricked the NXP LPC11C24 boards in March, we placed an order with a distributer for another ten boards. They only had four in stock, so we delayed the shipment with various other components for a month (to the end of April) hoping that they would ship a complete order, as freight was $70 a time. We did not need the stuff immediately anyway.

During the brief gap, we fired up the old K40 Freescale KwikStix boards and worked on the LCD character generator. We also dusted off the K60 Tower board and went through the source code of our RTOS after our code on both the K40 and K60 died unexpectedly during debug sessions. In both cases and for several different K40 boards, the processor could not be halted by the debug probe.

During an upgrade of the toolchain, we read that the dynamic breakpoints for Kinetis devices had been fixed. The code ran into the weeds when single stepping at the C source-level, but ran fine when single stepping in assembler. It also worked when stepping over functions rather than into functions. Often the processor could not be halted after stepping through a random location. A bit annoying, but still far better than the pre-historic printf days of the 68000 without any debug probe — reinforcing our belief that instrumentation needs to be added to targets even if the cost is slightly higher.

The trip through the LCD character generator was due to no LED to flash, and the only sign of life was the LCD. Perhaps the LED would drain the battery too quickly raising even more complaints. There are several unique symbols on the display and an array of pixels in a grid of 37×8, for up to 320 segments driven by only 48 lines. The KwikStix also has touch sensor keypads and test pins for connections to an external CAN transceiver.

The Freescale hardware designers and the company who wrote the sample code (plus developed the KwikStix board) did not spend much time together. Each pixel was represented as a byte, whereas we used a column (eight pixels) per byte, plus wrote to the display as a base pointer with incrementing byte addresses. The samples hard coded the 32-bit writes to the display. We are not going to post all the code due to all the land mines in software territory, but semiconductor companies could easily send out scouts to see what competitors like NXP and Atmel supply for bare-metal startup.

To the original board developers and software writers: “It would have been a lot more difficult to work out how to write to the display without your examples, so thank you, and hopefully the silicon vendors provide better documentation for future chips.”

Tales from the Woods

Politics

Editor' note: This is only relevent because it has affected the price of red wine, but we are a long way from NSW so perhaps we have missed something with “my kingdom for a bottle of wine”.

Businessmen, they drink my wine, plowmen dig my earth
None of them along the line know what any of it is worth


   All Along The Watchtower — John Wesley Harding album, 1968.
By Bob Dylan, Lyrics at Bobdylan.com

We though it would be better to leave out the references to jokers and thieves, but have a look at the excellent versions of this famous song on YouTube.

Well, for the price of a bottle of wine, the ex-leader of the New South Wales Liberal Party has walked away after years of dedication. Was there more to follow, or was it a publicity stunt by Penfolds to push up the price of 1959 Grange? We are from Africa, and believe if you are to be dishonest, do it at a Congressional scale, not over a bottle of wine that you cannot even remember receiving! Maybe there are similar rules in Oz, but let us not judge jokers or thieves, read the story yourself at Barry O'Farrell resigns after being caught out over bottle of wine, in the the Sydney Morning Herald, 16th April. The original breaking news from the media jackals claimed that the $3000 Grange was a gift, but if you look into the Cellarit website and under 1959, the Shiraz bottle will set you back $4250. That looks like a 40% premium in just over a month — perhaps a bit of insider trading as well?

In any case, the decks were cleared very quickly, and it is business as usual with the new broom promising to eradicate corruption. Same place next year?

Some wood

Poplar table top

To keep sane when writing embedded software, we dabble in a touch of woodwork. Here is a poplar slab converted into a long table top for plants. The top is “glassed” to keep it waterproof.

Motor Industry

While the local motor industry hopes that the early exit notice will actually reach the announced dates, it appears that the end-date will creep up as sales drop and employees head for the gates where there are alternatives. This is not a local matter, but a global one.

Peugeot and Citroen announced € 7,2bn ($10bn) losses over two years in Peugeot Citroen outlines recovery plan, on BBC, 14th April. They also plan to drop the number of models from 45 to 26.

Toyota had a bad month as reported in Toyota to recall 6.4 million vehicles, on BBC, 9th April. A brief scroll through the article mentioned that 1,9 million of the Prius recalls were due to a software fault that might cause the vehicle to slow down suddenly. In the past two and a half years Toyota recalled 25 million vehicles, while selling 21 million during the same period.

There were many other recalls, but for a local reference, see GM recalls another 1.5 million cars, on SBS, 1stApril. That would bring their recall figure to 6 million this year.

In our personal experience, we had a Toyota that would stop for low oil pressure (leak in the gearbox that would take 10 hours to repair), so to prevent it falling into the hands of some unsuspecting purchaser, we decided to scrap it. We received $207 at $150 per ton. The vehicle had 8 km under 200,000 when we drove onto the weigh bridge at the local scrap yard. It had served us well with the kids learning to drive and not bash the other cars. Would we buy another Toyota? Yes, we view the previous cases against them on embedded software as “marketing” by rival companies, as GM was a lot more dishonest with more people dying as a result of their faulty ignitions. The multi-billion dollar Toyota fines seem to be over the top compared to bank fines, or similar to the Apple vs Samsung “round corners patent” case with a jury who were unskilled in patents or mobile phones. Apparently, NASA had difficulty identifying any problem areas in the Toyota software (as covered in our March news).


Bankers

There was a brief honeymoon period when we opted for a business credit card for overseas internet purchases. Of course the charges would be much higher than a personal card. The billing period was not what we requested, the account was not online like our other accounts, plus the first statement said to ignore the request for payment if already made — which it was well before the end of the month or the requested billing cycle of the 7th. After the second similar letter, we decided to phone when we noticed that the previous two payments were not credited. Apparently, the money is to be paid into the billing account and not into the credit card, however, the online payment option was to enter the full credit card number into the account field and leave the BSB field open. Also, if a payment is made before the statement is sent out, the payment goes off against the balance and not against the minimum payment. Because we paid early, we were penalised with a $9 charge for “missing” the minimum payment.

Occassionally we report massive theft on the part of bankers together with the billions of dollars paid in fines (while nobody goes to jail), but here we were being robbed $9 at a time. We disliked the hour long bounce around the bank call centres. They could see that we had paid and would transfer the funds to the billing account, reverse the two $9 late payments, plus unsuspend the card! We were unaware of the suspension. The last straw was the $3,53 interest charge a month after we closed the card. The interest had to be paid into the billing account which we were told was closed. (What happened to the 55 days interest free when balance paid in full?) There was no confirmation of the account being closed or card handed in, even in the following month's statements which hinted at the full credit being available. When the bank eventually picked up the phone, we were told that it is not bank policy to acknowledge the card's return! We were assured that there would be no more deductions, but we will have changed banks by then.
Editor's note: The Australian banks made $6 billion out of overcharging over the past few years, so in August 2014, there is a class action case against the major banks for their eye gouging practices.

It has spoiled the relationship for the price or a cheap bottle of wine. Not sure what a new customer costs, but looks like under $30 to loose one. When the time arrives after completing the financial year, we will not be interested in filling out any satisfaction surveys after the phone call of over an hour interjected with machine generated “Your call is important to us”, or, “We are experiencing unusual delays”.

 

When the LPC11C24 order shipment date arrived (two months after initial order), it was delayed as the distributer asked us to revalidate the credit card information. Their email forwarded some cryptic error message from the bank which gave no hint of a suspended card. We resent the information with CVV and said if it did not work that we would supply details of an alternate credit card. (Company name truncated in the name field might not have matched at the bank, plus when we phoned, the bank said the card was issued in my name, not the company's?)

Public holiday here (Anzac Day) and timezone differences, plus people on email “out-of-office replies” in Canada, we found out a week later that the order had been cancelled via the order tracking link on their website.

The card that caused all the problems was paid off and cut into small pieces and handed in at the branch were it came from. That took almost an hour; about the same amount of time to fill in the application forms after receiving the preprinted promotional offer.

Cut up credit card

For customer service where “we bend over backwards to please” the card is ready for the convenient “shove it” kit.

Shove IT Kit

Collection of gloves

Shove-it kit

There are “the world's toughest disposable gloves” — low sweat nitrile gloves, lightly powdered latex disposable gloves, some hardy leather gloves for angle grinding, a pair of garden gloves, some Dettol, baby wipes for tears, ear plugs for complaints, scissors to cut the card up smaller if necessary, and of course, eye protection which is recommended whenever working with tools.

The long metal bar at the bottom is part of a clamp, and might come in useful. We use them all the time for glue-ups on wood projects.

Well, that is all done and dusted and off our chests, so we won't fall for future credit card promotional offers — debit card for overseas payments in future.