I haven't tried this out yet as I don't have an aTtiny85 handy but I put together a quick arduino sketch for the microcontroller novice like myself.
Code:
// Arduino sketch for an aTtiny85
void setup()
{
pinMode(1, OUTPUT); // SPIDIF/Phone pin / hardware pin 6
pinMode(0, OUTPUT); // Led pin / hardware pin 5
attachInterrupt(0, wake, FALLING); // innterupt "o" is on digital pin 2 hardware pin 7
}
void loop()
{
digitalWrite(0, HIGH);
delay(1500);
digitalWrite(0, LOW);
delay(1500);
}
void wake()
{
detachInterrupt(0) // Turn Intterupt off
digitalWrite(1, HIGH);
delay(50); //Dock Type Delay, 50mS for desk, 100mS for car
digitalWrite(1, LOW);
delay(50); //Charge type delay, 50mS for High current, 100mS for low
digitalWrite(1, HIGH);
delay(100); //Audio Connection delay, 50mS for connected, 100mS for disconnected
digitalWrite(1, LOW);
delay(600);
attachInterrupt(0, wake, FALLING); // Turn intterupt back on
}
---------- Post added at 07:27 PM ---------- Previous post was at 07:22 PM ----------
Quote:
Originally Posted by aggie6600
So this will allow you to fast charge without needing a custom kernel?
The idea is to be able to make a dock with a microcontroller in it that signals the phone the right settings for the dock. So yes it will set the phone to (AC) fast charge mode if you have it set to that.
I haven't tried this out yet as I don't have an aTtiny85 handy but I put together a quick arduino sketch for the microcontroller novice like myself.
Code:
// Arduino sketch for an aTtiny85
void wakeResponce()
{
detachInterrupt(0) // Turn Intterupt off
digitalWrite(1, HIGH);
delay(50); //Dock Type Delay, 50mS for desk, 100mS for car
digitalWrite(1, LOW);
delay(50); //Charge type delay, 50mS for High current, 100mS for low
digitalWrite(1, HIGH);
delay(100); //Audio Connection delay, 50mS for connected, 100mS for disconnected
digitalWrite(1, LOW);
delay(600);
attachInterrupt(0, wakeResponce, FALLING); // Turn intterupt back on
}
void setup()
{
pinMode(1, OUTPUT); // SPIDIF/Phone pin / hardware pin 6
pinMode(0, OUTPUT); // Led pin / hardware pin 5
attachInterrupt(0, wakeResponce, FALLING); // innterupt "o" is on digital pin 2 hardware pin 7
}
void loop()
{
while(1)
{
// Loop forever and blink led connected to pin0
count++;
if(count < 200000){
digitalWrite(0, HIGH);
}
if(count > 200000){
digitalWrite(0, LOW);
}
if(count == 400000){
count = 0;
}
}
}
---------- Post added at 07:27 PM ---------- Previous post was at 07:22 PM ----------
The idea is to be able to make a dock with a microcontroller in it that signals the phone the right settings for the dock. So yes it will set the phone to (AC) fast charge mode if you have it set to that.
A small thing I was going to note, and add to my firmware, is that we should be measuring the wake pulse if possible. As my code is right now, it responds to all pulses, including spdif data. Which will really mess with the data, resulting in something the SPDIF receiver/DAC will not enjoy.
But otherwise, that code gets the general gist of it.
Other note, the phone does report that it is in AC Charge mode when docked.
I am going to see if I can find something that I can drag out to my shop to see if the SPDIF data will feed directly into a stereo
You guys are incredible for actually going through with this. Its way more work that just using the fast charge kernels, but inspiring! Don't know if you saw or not, but Expansys said the Samsung docks are all manufactured, and they are trying to get an early shipment to France by the end of the month. Ya'll might still beat 'em!
I might even tear apart my Frankendock to solder something to the middle pin...
Denso TP-100, SE T61z, Moto RAZR V3, Motoi576, Nokia E52, HTC Desire HD, Samsung Galaxy Nexus withFNVPower!
and now NEXUS 7 !!!
There are still quite a few of folks who run Gingerbread on their … more
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?