Contribute
Register

MacTester57's iMac G5 17" (A1058 Model)

Status
Not open for further replies.
Joined
Dec 15, 2011
Messages
905
Mac
  1. Mac mini
Classic Mac
  1. iMac
  2. Power Mac
Mobile Phone
  1. iOS
Hi guys

I'm happy to officially announce my new project: an A1058 17 Inch G5 iMac, which I've bought for only 16.50 bucks last week. It was announced as defective. The non-working part is the logic board (LED 3 did not light up)

The auction is finished:
iMac G5_Ricardo.jpg


My current vintage Mac collection. From left to right: G5 Hack, HemiMac G4, G5 iMac (non-working), G4 Cube (my main system). In the background a G4 iMac in bad condition and one in perfect condition (both work flawlessly):
20140408-4083611.jpg


The original innards. This 17" model is very similar with Kiwi's 20" model and has back access:
20140408-4083616.jpg


The LCD and inverter test setup. The original PSU and inverter were used. The HDMI connector was soldered in accordance with Kiwis excellent guide - thanks again.
20140416-4163626.jpg


Caution: Pin 22, 23, 24 and 15 must be connected to 3.3V for this 17" model!!

Datasheet for this LCD Panel:
http://www.datasheetlib.com/datasheet/816649/lm171w02-tta1_lg-electronics.html

The prepared LCD cable, prior to soldering the connector. Oh my god, those wires are thinnnnnnn...
20140414-7147.jpg


The soldered HDMI connector. A magnifying glass and a thin soldering iron are a must-have:
20140414-7150.jpg


The inverter pinout:
20140415-7152.jpg

-Red = 12V supply
-Blue = 5V supply
-Blue = 5V enable
-Inverter off (floating)
-Green = brightness dimmer (0.7 - 3.3V)

Edit: correct pinout see here: http://www.tonymacx86.com/imac-mods/130197-mactester57s-imac-g5-17-a1058-model-2.html#post950142

The result. A working iMac G5 screen, connected to my G5 Hack: :D
20140416-4163625.jpg


One strange thing is the fact, that the screen is not detected as iMac and therefore OpenGL does not work. Your thoughts?

The current Arduino based SMC test setup. It will be compatible with Kiwi's excellent slider applet:
20140416-4163628.jpg


More details will follow, but the project will need more time to complete than Ersterhernd's...

Happy hacking

MacTester

Video presentation of the almost finished project: (with the SMC prototype board)

This project is now finished.
Details & software see here: http://www.tonymacx86.com/imac-mods/130197-mactester57s-imac-g5-17-a1058-model-11.html#post1039057
20150526-5264292.jpg


20150524-5244284.jpg


Finished SMC Board.jpg


Build Video:

Running macOS Sierra, together with my "HemiMac":
 

Attachments

  • SMC Kit V1.0.zip
    4.8 MB · Views: 781
Last edited:
Looking fwd to great things with this one! I'm sure the bar for G5 builds is about to go WAAYYYY up! I was really hopeful that you would take one of these on, MacTester. Looks like I got my wish... ;)


Cheers!

Ersterhernd
 
Hi guys

...One strange thing is the fact, that the screen is not detected as iMac and therefore OpenGL does not work. Your thoughts?

...More details will follow, but the project will need more time to complete than Ersterhernd's...

Happy hacking

MacTester
From memory my LCD is detected as an iMac device, can check this detail latter, however I don't see how this impacts OpenGL functionality. Isn't OpenGL a software API, that allows for accelerated graphics, the main dependency is the graphics chip-set and a supporting driver?

EDIT: Is EDID wired correctly, this is what allows OS to detect LCD type.

The 17" is fairly similar to the 20" the placement and size of the inverter seem to be the major changes, but space will be at a premium if you keep the ancillary internal components.

Looking forward to your progress and seeing where you go with Arduino implementation, but I am wondering what you might need to control a servo for ?

Kiwi

PS: Can you fix up the malformed code tags on you post 131 in my build thread. Thanks
http://www.tonymacx86.com/imac-mods/107859-kiwis-next-project-imac-g5-14.html#post778707
 
I'm sure the bar for G5 builds is about to go WAAYYYY up!
We will see...

EDIT: Is EDID wired correctly, this is what allows OS to detect LCD type.
Yes. The problem was my G5 Hack :oops: If the iMac screen is connected to the Cube, everything works as it should.

PS: Can you fix up the malformed code tags on you post 131 in my build thread. Thanks
It's done.

... but I am wondering what you might need to control a servo for ?
This feature could be useful in a iMac G4 build to push the drive door open (if there are USB ports behind it). It will not being used in this build.

Happy easter.

MacTester
 
After a long planning phase, the SMC board layout is finished.

It will be similar with Kiwi's, but almost completely different in detail. It will be equipped with:
- 3 independent PWM controlled original Apple fans
- Fan rotation detection, using the tach signals
- 3 Dallas 18B20 temperature sensors, connected with a one wire bus
- Original PSU control
- 2 touch sensor ports
- 1 door servo port
- Backlight inverter control
- Sleep LED controller
- onboard LS1820 Apple Chime controller
- Onboard audio amplifier
- NUC power control

Thanks again to Kiwi for pioneering the Arduino based SMC.

The layout, drawn with the free Inkscape software, in accordance with this guide: http://www.zen22142.zen.co.uk/Prac/inkscape/ink.htm
iMac G5 SMC Layout.jpg


Final tests, using a 2nd Arduino for measuring the power transistor temperature:
20140511-5113634.jpg


Soldering in progress...
20140513-5133635.jpg


More details will be posted after (hopefully) everything works...

MacTester
 
Last edited:
WOW. Most awesome job. I don't need to ask how long you board took to design, but the result is worth it. I especially love the colour coding of individual resistors.

Kiwi
 
Great work! I have two iMacs that are this exact same model and if I'm not making them into all-in-one hackintoshes, then they're gonna become secondary displays with speakers, USB ports, optical drive, etc. Could you show me later on how to exactly wire up the display and inverter on this model? Thanks and keep on, good work! :headbang:
 
Thanks for the positive comments, guys!

Here is a small update. The SMC is almost finished now:

Doing final tests with the LS1820 Sound recording chip. The ROSC resistor on the original board (which is used for recording the Apple Chime" sound) was replaced with a 82K value to achieve the maximum possible sound quality. Nevertheless, the sound quality is lousy... I will try later to replace the microphone with a better one:
20140516-5163640.jpg


All small components are soldered:
20140517-5173641.jpg


First test, with only one fan connected. Works fine!
20140518-5183642.jpg


Now are all three fans connected. All the three DS18B20 temperature sensors are connected to the same digital pin and work fine. The fan PWM values are a bit higher until fan rotation is detected and are then lowered to the value which is calculated in accordance with the temperature readings.
20140518-5183644.jpg


All three fans and the Inverter output are driven with 31.5kHz PWM frequency. Otherwise the fans would be noisy. To achieve that, I've enhanced Kiwis setPWMPrescaler() function. This modification allows to adjust the PWM frequency for pin 6:

Code:
//
// -----------------------
// PWM FREQUENCY PRESCALER
// -----------------------
//

/**
 * Arduino Leonardo AtMega 32u4 specific
 * Sets the Prescaler (Divisor) for a given PWM pin. The resulting frequency
 * is equal to the base frequency divided by the given divisor:
 *   - Base frequencies:
 *      o The base frequency for pins 3, and 11 is 64,500 Hz.
 *      o The base frequency for pins 5, 9, and 10 is 31,250 Hz.
 *      o The base frequency for pins 6 and 13 is 125,000 Hz.
 *   - Divisors:
 *      o The divisors available on pins 3, 5, 9, 10 and 11 are: 1, 8, 64, 256, and 1024.
 *      o The divisors available on pins 6 and 13 are all powers of two between 1 and 16384
 *
 * PWM frequencies are tied together in pairs of pins. If one in a
 * pair is changed, the other is also changed to match:
 *   - Pins 3 and 11 are paired on timer0 (8bit)
 *   - Pins 9 and 10 are paired on timer1 (16bit)
 *   - Pins 6 and 13 are paired on timer4 (10bit)
 *   - Pins 5 is exclusivly on timer3 (16bit)
 *
 * Note: Pins 3 and 11 operate on Timer 0 changes on this pins will
 * affect the user of the main time millis() functions
 */
void setPWMPrescaler(uint8_t pin, uint8_t prescale) {
  if (pin == 3 || pin == 11) {  // Pin3 tested, OK, but millis() is affected!!
    byte mode;
    switch (prescale) {
      case 1: mode = 0x01; break;
      case 8: mode = 0x02; break;
      case 64: mode = 0x03; break;
      case 256: mode = 0x04; break;
      case 1024: mode = 0x05; break;
      default: return;
    }
    TCCR0B = TCCR0B & 0b11111000 | mode;  // timer0
  }
 
  if (pin == 5 || pin == 9 || pin == 10) {
    byte mode;
    switch (prescale) {
      case 1: mode = 0x01; break;
      case 8: mode = 0x02; break;
      case 64: mode = 0x03; break;
      case 256: mode = 0x04; break;
      case 1024: mode = 0x05; break;
      default: return;
    }
    if (pin == 9 || pin == 10) {  // Pin 5, 9 & 10 tested, OK
      TCCR1B = TCCR1B & 0b11111000 | mode;  // timer1
    } else {
      TCCR3B = TCCR3B & 0b11111000 | mode;  // timer3
    }
  }

  if (pin == 6 || pin == 13) {  // Pin 6 tested, OK
    byte mode;
    switch (prescale) {
      case 1: mode = 0x01; break;
      case 2: mode = 0x02; break;
      case 4: mode = 0x03; break;
      case 8: mode = 0x04; break;
      case 16: mode = 0x05; break;
      case 32: mode = 0x06; break;
      case 64: mode = 0x07; break;
      case 128: mode = 0x08; break;
      case 256: mode = 0x09; break;
      case 512: mode = 0x0A; break;
      case 1024: mode = 0x0B; break;
      case 2048: mode = 0x0C; break;
      case 4096: mode = 0x0D; break;
      case 8192: mode = 0x0E; break;
      case 16384: mode = 0x0F; break;
      default: return;
    }
    TCCR4B = TCCR4B & 0b11110000 | mode;  // timer4
  }
}

The following additional functions are successfully tested:
-Breathing sleep LED
-Touch sensors
-Door servo

To do:
-Testing the Inverter
-Testing PSU deactivating output
-Testing the LS1820 on the SMC
-Buying a NUC, then writing and testing the Power State FSM...

Good hacking
MacTester
 
Last edited:
MacTester I think that your projects, and this one in particular, are done very well and reflect great attention to detail AND a high level of creativity. Also your value add circuits just blow me away.

I was pleased with the first post in this thread where you show six systems/projects. I intend to show that post to my wife.

Good modding,
neil
 
I was pleased with the first post in this thread where you show six systems/projects. I intend to show that post to my wife.

LOL! It's always good to see, that you're not the only addicted. ;)

To do:
-Testing the Inverter
-Testing PSU deactivating output
-Testing the LS1820 on the SMC

-The inverter is simulated with a LED on the big breadboard an can be controlled with Kiwis slider applet or the touch sensors
-The PSU deactivation works fine (at least with the NUC dummy). It's controlled from a FSM.
-The Apple Chime works and is triggered from its own FSM in accordance with the current power state and the power state before.

This is the current test setup. The small breadboard on the right side simulates a NUC and is supplied from the 5V (not Standby) rail. Because the 3.3v rail of my bench PSU is defective, I've used a 3.3V regulator on the big breadboard to supply the LS1820 and the inverter circuit.
20140524-5243645.jpg


I think the next step will be to buy a NUC...

MacTester
 
Last edited:
Status
Not open for further replies.
Back
Top