Announcement

Collapse
No announcement yet.

Re-engineered M2-atx firmware with fixes and added functionality

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Re-engineered M2-atx firmware with fixes and added functionality

    First off, let me say that I have been a lurker around here for quite some time, but I am a newb at contributing to forums so let me apologize in advance for any etiquette infractions that I commit... I assure you they are unintentional and I will learn

    I have an M2-atx psu, and like many others, I was annoyed by the 5 second delay that occurs on power on. I set out to shorten that delay while ensuring that my power supply still worked as advertised. The farther I dug into the code, the more I discovered it was an unbelievable mess, so in the end I decided to reverse-engineer the operation of the psu and re-write the firmware, which I have done. I finished the current version of the firmware early last year and was promptly sidetracked with real life (job, getting married, moving, etc....) so I have not been working on my carPC since then.

    However, it seems that my opinion that the operation of the M2-atx is sub-optimal is pretty widely shared, so I am going to undertake the process of figuring out if my code can help others here on the forum. I have not decided how I am going to release the code into the wild yet, but any constructive suggestion or encouragement would be appreciated!

    I am not particularly interested in trying to make money off of the forum users, as I depend on forums and open source contributions for supporting my hobbies as well (linux, xbmc, this forum). However, I have added functionality to the psu as well as removing bugs, so I feel that it has added value and am not ready to just give it away for someone else to sell.

    My plan is to demonstrate the functional differences, probably in a before/after type video and to enlist the help of a few people to functionally verify that the code works for them too. After the code has been tested a bit, if companies like mini-box or mp3car are interested in selling it, I guess they can contact me...

    Until I have a chance to post more details, please leave feedback if you are interested in the code, you have a bug in operation that you think code might be able to fix, or just want to offer some motivation! More details when I am not at work...

    EDIT:

    see more details about my firmware farther along in the thread:
    http://www.mp3car.com/vbulletin/powe...ml#post1373099

    also, check out some videos demonstrating the functionality here:
    http://www.youtube.com/user/bluTDI09

  • #2
    i'm definitely interested. Would you be able to add more shutoff times as well?
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

    Comment


    • #3
      Originally posted by Sonicxtacy02 View Post
      i'm definitely interested. Would you be able to add more shutoff times as well?
      I have already modified the shutoff timings to suit my liking as well as added more options for additional jumper combinations. I will post the details of what I chose when I get home and can look at the code, but I can easily set it to whatever people would want.

      Comment


      • #4
        wow!

        Here's another addition.
        If I'm wrong just ignore me then

        But if the M2 has bad code wouldn't the other psu lines have similar problems?

        As a business adventure, good luck, but I really wonder how many units would have to be sold before you get even a quarter of your effort back

        Still, go for it and I do really hope you can make a profit

        Comment


        • #5
          You might want to look into the legality of what you are doing.

          Reverse engineering of someone code is usually against the terms and conditions.


          Now doing it for yourself and the product you have bought is fine.

          However if you then try and distribute that, you could be break the T&C's.

          As such we could not allow that sort of discussion on this forum.


          I would suggest you contact minibox with your findings and discuss with them if they are happy for you to distribute your code (unlikely as it would bring up warranty issues if peoples M2 start failing) or whether they would be interested in working with you in getting the code 'right'.

          Comment


          • #6
            Originally posted by SapporoGuy View Post
            wow!

            Here's another addition.
            If I'm wrong just ignore me then

            But if the M2 has bad code wouldn't the other psu lines have similar problems?

            As a business adventure, good luck, but I really wonder how many units would have to be sold before you get even a quarter of your effort back

            Still, go for it and I do really hope you can make a profit
            It is my understanding that the M1 and M2 share code but the M3 and M4 are entirely different, so the M1 may share some of the same problems as the M2... It may have problems that even perfect code won't fix, but I would not be surprised if some of the weird powering on and off problems that people see are code related. We will have to see...

            As far as this being a business venture, the work is mostly done already and if I get any compensation for my effort it is better than not, but that was not my original intent. I just want to make sure that credit is given where credit is due... And I am sure that I will be able to help some fellow carputer-ers along the way!

            Thanks for your reply!

            Comment


            • #7
              if you can make the M2 keep the 5V on until a set threshold voltage like the DSATX, it'll make the M2 sooooo attractive.

              Comment


              • #8
                Originally posted by Enforcer View Post
                You might want to look into the legality of what you are doing.

                Reverse engineering of someone code is usually against the terms and conditions.


                Now doing it for yourself and the product you have bought is fine.

                However if you then try and distribute that, you could be break the T&C's.

                As such we could not allow that sort of discussion on this forum.


                I would suggest you contact minibox with your findings and discuss with them if they are happy for you to distribute your code (unlikely as it would bring up warranty issues if peoples M2 start failing) or whether they would be interested in working with you in getting the code 'right'.
                Thanks for the input, that is a good idea. I actually did not reverse engineer the code... I looked at the available source (from 2005 or so) to see if I could just make simple modifications as others have suggested and tried. In the end, I only used a couple of things from that code (such as the ADC technique for monitoring battery voltage) and rewrote the rest from scratch because they did not utilize the PIC's capabilities very well. I will list all the differences when I can get home and look at the code.

                I had considered contacting minibox before to see if they were interested in working with me but for some reason decided not to... but your point about warranties is a good one so maybe I will see what they say. That being said, I also am not interested in doing or discussing anything illegal regarding terms and conditions of use of the PSU, so I will try to look into that further and post any feedback I get.

                I do not think that my code will cause any psu to fail... in fact it should be less likely to because the timing scheme and communication with the motherboard I implemented is precisely compliant with the ATX standard (which I couldn't verify with the minibox code). But additional testing may find bugs that my setup doesn't have so I make no warranty claims at this point!

                Comment


                • #9
                  just buy a stock of PIC's, flash them to your code and sell them here on the side. if theyre good chips, people will buy them. id spend $15 on one if i knew it would make my m2 more stable and add features.

                  Comment


                  • #10
                    Originally posted by bluTDI09 View Post
                    I have already modified the shutoff timings to suit my liking as well as added more options for additional jumper combinations. I will post the details of what I chose when I get home and can look at the code, but I can easily set it to whatever people would want.
                    I like the idea of different shut-off routines as well. Maybe something along the lines of a hard off after 12-24 hours. My thinking for this would be that since I drive my truck every day of the week, I think (although I haven't tested it yet) that I have enough battery to run stand-by from the time I shut the truck off in the evening until I go to work the next morning. But, if the truck sits for more than a day, a hard off would then kick the Windows 7 hybrid sleep mode into hibernate.

                    Thanks...
                    Mark
                    --------------------------------
                    Project completed! (almost)

                    My Truck as featured in Custom Classic Trucks magazine.

                    Comment


                    • #11
                      The 5 second power on delay thing is annoying, but in addition to adding more timing options, what more could you add to the M2? I still dont quite understand how a software upgrade will make the M2 more stable, because it seems to do the job right now just fine. The M2's flaws (such as blowing up motherboards if overloaded) seem to be more of a hardware issue.

                      Anyways, I dont think the code itself should be sold. This is a community of hobbyists and new ideas are usually shared freely with everyone else. I could see a pre-flashed chip being sold, but as for a simple piece of code I dont think it will go any farther than a donation.

                      Comment


                      • #12
                        As I said earlier, I am not looking to just sell the code, except maybe to mini-box so that they can sell psu's with the code. I am somewhat considering offering pre-flashed PICs that can just be dropped in for the old one if people are interested in that, but as I have a full time job and a life I am not sure whether I can responsibly commit to that service.

                        Since some people are wondering what is different about the functionality, the main difference between my code and the original is in the way that it keeps time. My code uses interrupt based timing, which allows me to be more flexible with the operation while the interrupts are not occurring, which is the vast majority of the time. The mini box code just sits there in (not very well constructed) counting loops most of the time, so in order to implement the delays for all the timing modes, the program jumps all over the place. I will explain better later...

                        One other main difference in functionality is that I implemented diagnostic error feedback by flashing codes through the LED to show what the psu is doing at different times. For example, if your computer just powers off for no apparent reason, you can look at the LED and see why. Again, I will explain more later.

                        Thank you all for your feedback and thoughts. Keep them coming.

                        Comment


                        • #13
                          I too would definitely be interested in your code. Some time back, I started the same project: to rewrite the M2-ATX code (probably in C) to clean it up and add more functionality.

                          I never did much work on this other than grabbing the source code (ASM) off the web and making some minor tweaks to ensure it matched exactly the binary that shipped in my M2 (read binary out of M2, disassemble with IDA Pro, modify source to match).

                          The features I was looking to add were:
                          1. Change PIC controller to 16F87 (footprint compatible) to get UART for control/status information (with suitable RS232 level translation IC).
                          2. Use EEPROM in PIC controller to store timing settings.
                          3. Add input for door unlock (from remote) to power up CPU before I get to the car.
                          4. Allow PC to delay shutdown (up to a limit) using serial link to allow it to sync with my media server when I get home.
                          5. Provide separate control over +12V output (which I use to power my LCD).

                          Cheers.

                          Comment


                          • #14
                            That sounds very interesting, where about in KY are you, I am just north of Louisville and if you need any help id be happy to if i can.

                            Comment


                            • #15
                              Originally posted by mpr90 View Post
                              I too would definitely be interested in your code. Some time back, I started the same project: to rewrite the M2-ATX code (probably in C) to clean it up and add more functionality.

                              I never did much work on this other than grabbing the source code (ASM) off the web and making some minor tweaks to ensure it matched exactly the binary that shipped in my M2 (read binary out of M2, disassemble with IDA Pro, modify source to match).

                              The features I was looking to add were:
                              1. Change PIC controller to 16F87 (footprint compatible) to get UART for control/status information (with suitable RS232 level translation IC).
                              2. Use EEPROM in PIC controller to store timing settings.
                              3. Add input for door unlock (from remote) to power up CPU before I get to the car.
                              4. Allow PC to delay shutdown (up to a limit) using serial link to allow it to sync with my media server when I get home.
                              5. Provide separate control over +12V output (which I use to power my LCD).

                              Cheers.
                              Wow, that is quite a bit more functionality than I was striving for.... but it sounds like it would be very cool if it would work.... I am not familiar enough with the 16F87 to know if it would allow all the functionality you describe while maintaining the current functionality of the PSU because all of the IO pins are used in certain ways and can't be shifted around. You might be able to lose some of the jumper configuration and wire up to those pins (Rb0-Rb3 on the 818/819)... I will be glad to help in any way that I can if you do decide to go for it.

                              Comment

                              Working...
                              X