Thursday, June 05, 2008

Fixed the old iBook!

What was broken...

... has now been healed.


After having gathered dust for over a year, my dad finally pestered me enough to fix my old iBook G4 14". The problem was the DC power in board, which was a breeze to replace. Thanks to dad for getting me onto MacAlert in Plympton (with their friendly and effecient service - now I know where to go whenever I need help with something Mac-related). Many thanks also to Tristan Louth-Robins for the iBook AC adaptor from his old laptop.

12 comments:

dontmarryme said...

hi sebastian:
i m having some trouble to controlling 64 leds with 8 595 chips, i use 8 shiftout but the sequence is really unstable, here is my code, i was wondering if u can give me some help.


int latchPin = 8;
int clockPin = 12;
int dataPin = 11;
byte shiftOut1=0;
byte shiftOut2=0;
byte shiftOut3=0;

void setup()

pinMode(latchPin, OUTPUT);
Serial.begin(9600);



void loop()

if (Serial.available())

shiftOut1=Serial.read();
shiftOut2=Serial.read();
shiftOut3=Serial.read();

digitalWrite(latchPin,0);
shiftOut(dataPin,clockPin,shiftOut1);
shiftOut(dataPin,clockPin,shiftOut2);
shiftOut(dataPin,clockPin,shiftOut3);

digitalWrite(latchPin,1);


delay(10);

dontmarryme said...

can u fix ipod as well? :P
mine is down lol

Sebastian Tomczak said...

You would want to at least use:
...
if(Serial.available > 2) {
...
}

because this way you listen to the bytes in blocks of three. Make sense?

Sebastian Tomczak said...

Haha, yeah I hear that this is a common problem with ibooks from this era :(

It was REALLY REALLY easy to do.. (and I have never tried to fix anything on a computer before, at least not the hardware). the hardest thing was taking the computer apart...

dontmarryme said...

thx for the answer is useful like all the time.
anyway it takes ages for me to learn how to fix ipod i think, so wats ur majoring in college? i m just curious and i m planning to study aboard as well, i m not up for the school that is totally about tech, actually i m from fine art school, although these arduino stuff are reeally fun.

Sebastian Tomczak said...

iPod is more difficult maybe?

Anyway, I originally come from a classical music background, but I have studied Music Technology (this is in the broad sense, and includes things like composition, music theory, musicology and ethnomusicology, history, programming, synthesis, hardware etc).

dontmarryme said...

hey there
i tried too add if serial.available >7 (for 8 shiftout)
but still unstable, because sometimes if i send list to arduino too fast, it still get disordered.
why is that? do i still have to name each byte? i really dont want to, cause i have to send byte of 64 buttons and i havnt figure out how to combine those 2 arduino code file.

and thx for tell me ur background! its cool!
and wats the name of ur department?

Sebastian Tomczak said...

Hey,
Hmm. I guess you could try and slow down the data throughput on the Max/MSP side of things (the speedlim object comes to mind, for example).

Or you could make up some sort of protocol, maybe similar to MIDI data, like so:

1) you break up your 8 bytes into 16 nibbles

2) then you make up a single-byte protocol sort of thingy, like this:

Each byte is made up of eight bits. The four high bits (high nibble) is the address. The four low bits (low nibble is the data):

%aaaa dddd

thus you have 16 nibbles @ 4 bits each = 64 bits
(so you can squeeze in the whole 8 bits x 8 bytes = 64 bits in).

Make sense? This is pretty fool proof, in that the data is automatically associated with an address in EVERY BYTE and EVERY CASE, right? So give it a shot. I can try and help you with code if you would like me to.

Sebastian


PS> The name of my department is the Electronic Music Unit

dontmarryme said...

if (Serial.available() > 9)
shiftOut1= Serial.read();
shiftOut2= Serial.read();
shiftOut3= Serial.read();
shiftOut4= Serial.read();
shiftOut5= Serial.read();
shiftOut6= Serial.read();
shiftOut7= Serial.read();
shiftOut8= Serial.read();
shiftOut9= Serial.read();
shiftOut10= Serial.read();
delay(10);

digitalWrite(latchPinOut,0);
shiftOut(dataPinOut,clockPinOut,shiftOut2);
shiftOut(dataPinOut,clockPinOut,shiftOut3);
shiftOut(dataPinOut,clockPinOut,shiftOut4);
shiftOut(dataPinOut,clockPinOut,shiftOut5);
shiftOut(dataPinOut,clockPinOut,shiftOut6);
shiftOut(dataPinOut,clockPinOut,shiftOut7);
shiftOut(dataPinOut,clockPinOut,shiftOut8);
shiftOut(dataPinOut,clockPinOut,shiftOut9);
digitalWrite(latchPinOut,1);




Serial.print('L');
Serial.print(switchVar1);
Serial.print(switchVar2);
Serial.print(switchVar3);
Serial.print(switchVar4);
Serial.print(switchVar5);
Serial.print(switchVar6);
Serial.print(switchVar7);
Serial.print(switchVar8);
//Serial.print(val0);
//Serial.print(val1);
//Serial.print(val2);
Serial.print('W');
delay(100);


however if i increase the speed of Serial.begin from 9600 to 57600, it become more unstable so i really dont know wats happening here....and if u wanna give a shot...thx! i'll be grateful.

dontmarryme said...

ps. Now i know where the problem is...(after 5hs), it is the Serial.print and Serial.read are disturbing each other (i was trying to combine shiftin and shiftout code). Whenever i try to turn on all the leds it gets disorder, but if i turn on it one by one then it is okay.

Matthias Tomczak said...

Hi Seb, what do you mean "I finally got around to ..." and ":thanks to MacAlert .."? Shouldn't there be a "Thanks to Dad for pestering me for months to get this done and pointing me towards MacAlert" as well? Anyhow, it's good to see a photo of the iBook alive again as I was only around to see it taken apart.

Sebastian Tomczak said...

Okay, okay. I will change it!
You don't have better things to do with your time, do you? :-)