Skip to main content

Android on Kaiser hacking

I have been messing around with getting Linux to boot on the HTC Kaiser, with the end goal of ditching windows. Presented is the LED hack. I am suffering from NIH syndrome on this one, but still cool.

EDIT: I got some emails asking how I got Android on there...
XDA-developers tells you what you need to know. Other non-Kaiser HTC devices should check the XDA developers Wiki

EDIT2: The phone works in Kaiser! Nice work premy!

How?

In a nutshell-> An LED on the phone keyboard is flashed on and off at high speed by incoming serial data.
The serial code that is normally used to talk to a hardware UART is horribly hacked to pipe all serial communications out through the fn led on the keyboard. This is then read by an LDR that is connected to an AVR ADC port. The ADC port then polls the LDR waiting for it to go over a defined threshold. For each 8 bits of on-off flash sequences form the phone, the AVR will combine and put them into a register ready for reading.
The PC then reads the data through USB from the AVR using Dick Streefland's usbtiny software USB stack.

In fact, the whole hardware is based on my OSIF board, with a couple of extra headers soldered on and some small code to parse for the flash sequence.

Why?
Because it's coooool.
In all seriousness I needed to get that data out of the device somehow. Copying log entries by hand is a pain.

Where are the pictures?
Okay, Okay.


Yes, this is running Google Android :)


But it's only one way!
Well, unless someone fixes communications with the real world before I get around to hacking that up, its tough.

Code?
It is all in an MCU and pretty standard stuff. Let me know if you are interested, and I might clean it up.

Here is a sample of the pseudocode I wrote before I went and coded this up.

ISR timer overflow
{
   in_byte = TRUE
   adc = read_adc(CHANNEL_1)
   if (adc >= THRESHOLD)
       final_byte |= (1<<clock_pulse)
   else
       final_byte & = ~(1<<clock_pulse)
  
  clock_pulse++

  // reset the clock counter at the end of the byte
  if(clock_pulse == 8)
  {
       clock_pulse = 0
       final_byte = 0
       in_byte = FALSE
       timer_disable()
   }

  timer_reset()
}        


main {
...
//check to see if we are mid byte
if (in_byte == FALSE && sync == TRUE)
   check_for_1ms_sync()
   {
       in_byte = TRUE
       timer_enable()
    }
...

Yes, there is no sync handling, but for the small amount of data I need out of it, there is no issue.

Speed seems to be around 200 bps

Application Installation

Have you managed to install an Android application. If so, how? I tried placing it in the android-data.bin file and packaging it back up, but no luck. I've talked to people on IRC that said you've done it, so I'm curious as to how. Thanks in advance.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.