Manga Screen Rev A2 – How to assemble

Populate the PCB

Remember to take your protein pills before such an endeavor. tools

Apply solder paste at strategic locations. Doesn’t have to be perfect, it will smear out in the reflow oven. solder-added

Into the oven it goes. This was actually after being in the oven. There are a lot of bridges here, these must be removed with a solder iron, flux and solder braid.
Manga Rev A2


This revision has an Atmega 32U4 AVR chip so there should be plenty of power to spare for anyone wanting to do some fancy touch filtering. The source code is in the Manga Screen repository.

Atmel stopped supporting FLIP for Linux on version 3.2.1, before they added support for Atmega 32U4, so in order to program the Atmega 32U4, I had to do the following:

sudo apt-get install  dfu-programmer

dfu-programmer atmega32u4 erase

dfu-programmer atmega32u4 flash MangaScreen.hex
6436 bytes used (22.45%)
dfu-programmer atmega32u4 reset

The reset command sets the program counter (PC) to 0×00 so the user program starts. If you hit the reset button at any time, the PC will jump to the start of the bootloader code.

USB Device

The USB driver is built on top of the LUFA library.  It should populate as a USB with two devices, one serial port and on Human Interface Device (HID). The serial port will accept commands such as “set display on”, “set backlight 128″, “set gamma yadayada”. perhaps also Upload/download EDID etc.  The HID  will of course be the touch screen.

Software implementation of a slave EEPROM chip

A couple of weeks ago we did not know that the EEPROM chips that are present in all displays and supplies the host with EDID info can also be programmed through the HDMI cable. Therefore we thought the best thing to do would be to let the AVR chip handle the role of the EEPROM. The problem was that the I2C controller on the AVR had been reserved for the touch screen controller so we had to use two GPIO lines and handle the timing our selves. But there was only one interrupt line available so we gave that the the SCK line, when actually it is the SDA line that initiates the start and stop conditions. So if anyone ever decides to do make the same mistakes we did, you might enjoy the EEPROM.c and .h files found in the repository. However, my advice is: Spend that extra 10 cents on a real I2C EEPROM chip : )

The (almost) final result

As you can see in the picture below, the screen works fine and dandy. Right now it is run through the DVI interface of my Ubuntu box at the native resolution of 480×800@60Hz. The idea is that this screen will be used primarily with the HDMI interface for BeagleBone Black.


I also made a video as soon as I got the screen working. Here it is:

Manga screen rev A2 from Elias Bakken on Vimeo.

The next step

That is to get the touch functionality working by porting the Linux driver for the mXT224 to the AVR.

44 thoughts on “Manga Screen Rev A2 – How to assemble

    • As far as I know I does not work with a “clean” atmega. You need update the device with a new boot loader. Am I wrong?

  1. Hi,

    I’ve made a derivative of your excellent screen interface but moved the connectors so that the come out the back instead of the bottom. That way I can mount it on a goose neck and have the wires neat and tidy behind.

    What do you think?


    • Nice Steve! I’m hoping you will help with the software then : ) If you are good with interpreting multi-touch USB protocol specification, that will come in handy!

      • My word that was hard. Last night I put it together. How many solder bridges!!! Going to take me a week to check for shorts.

        This is by far the smallest pitch components I’ve put together to date. I’m always worried that the QFN package will be shorted underneath.

        Anyway, yes sure. Multi-touch. I’ve not played with a HTC Desire, but how many touches can you actually do on it? Because reading the Atmel mXT224 brochure it says it can only do two! (Last sentence on Overview tab) or am I reading it wrong?

  2. So, I got everything debridged, found that I took too much solder off so added some back, had a dead led, and have managed to program and install the firmware, however I can’t get anything to display.

    I’ve put the commented out lcdtest code back, into the firmware and it comes back with what looks like the correct data.

    Did you have any hardware issues when you put yours together? Any debugging tips?

    I did notice that when I try and initialise the Digitizer, it hangs at the TWI init, so still wondering if there’s a soldering issue.

    • Check hsync, vsync, pclk and disp. You might have to use one of my custom kernels to get the active levels on h and v sync right. I think the latest on has what you need.

      • Ok I had a hair of a bridge on the SDA/SCL line.

        Now the issue is that the EEPROM.c code is just not recognizing the I2C data.

        The BBB is sending a 0×60 followed by a 0xa0 but the ATMega is reading 0×90 and 0xff. So weird.

        I think I’m going to hack the circuit and put SDA on the interupt line and maybe even put on a 24lc256.

        As for the touch screen. That was failing because I uncommented the lcdtest which used up all the ram thus the digitizer code was failing on a malloc.

        I’ve now moved most of the Strings to flash and only use printf when and if I need a variable outputted.

        So hopefully I can start on looking at multitouch with that.

        This Hobby is sometimes very frustrating.

        • Steve, you should not have to use the software EEPROM code. Since you have a hardware EEPROM, you should be able to program the EEPROM directly from the BeagleBone through the HDMI cable.

          • Yeah. Unfortunately I made the board before I realized the mistake. I fixed the Circuit but didn’t get a new board made up (Cost too much). Call it being over exuberant on my part.

            No biggy. But it’s interesting to see what sort of I2C messages are sent. My PC sends about 20 messages!

  3. This is a really cool project, I would love to get my hands on one to play with. What are your plans for the eventual release? Will it be bundled with Replicape or available separately?

    Being able to add an affordable touch screen UI to Beaglebone is going to be absolute gold.

  4. You got any advise on how to get this working?

    I’ve made two units and both are not displaying anything. I’ve modified the edid that you put together to have a higher pixel rate and Horizontal freq so that it’s above the minimum of the TFP401 but below the max of the LQ043.
    I’ve augmented the ATMega code to give feedback of the SCDT pin to see if there is a Sync detect, but it’s always inactive.
    I’ve forced the BBB to boot at the screen resolution.

    I can’t seem to see what’s wrong. All the electricals seems to be correct and connected. Did you have to change anything on your PC/BBB to get it to output?

    • There are four test-points on the original board, Hsync, Vsync, Pclk and disp, if they are not firing, then there is something wrong before the LCD itself. Also, you can measure the data lines coming from the HDMI connector. Anything? If there is a signal, make sure V and H sync are the right phase (Don’t remember which is right right now). You might need one of my kernels to fix a bug with that..

      If not, your BBB is not outputting any signal. In that case, I suggest you check dmesg to look for “invalid edid” or something similar.

      • I tried changing the failing/rising edge in the EDID. The EDID in your bitbucket repo are all – but the edid on your blog is +.

        The only thing of interest in the dmesg is
        bone-capemgr bone_capemgr.9: loader: failed to load slot-5 BB-BONELT-HDMI:00A0 (prio 1)

        But in slot #6 I get
        ] bone-capemgr bone_capemgr.9: slot #6: dtbo ‘cape-boneblack-hdmin-00A0.dtbo’ loaded; converting to live tree

        and it’s working with a normal monitor.

        I’ll try probing the signals, but it will be to the limit of my scope and saleae analyzer.

        I think I may get one of your original boards made up.

        Just in case it’s my moving of the HDMI plug from horizontal to vertical has caused me to miss something.

        • I’ve Got it working Finally!!!!!!!

          I have beautiful images on my screen. It was all down to the EDID!

          I just could not get your EDID working. So I finally got it working with the following

          Mode “480×800″ # vfreq 64.888Hz, hfreq 51.975kHz
          DotClock 25.000000
          HTimings 480 481 487 481
          VTimings 800 801 804 801
          Flags “-HSync” “+VSync”

          Now on to the touch screen.

          • Hey Stephen

            I have gotten the touch working for an Ubuntu computer. Have not tested it on BBB yet because it somehow died :p

            It’s in the repository, so you could check it out and maybe test it for BBB.

  5. Was it in use in the replicape? I’ve seen a few reports that controller boards connected used to control 3d printers have killed themselves due to static build up in the plastic rubbing while printing.
    I’ve always wondered about that and if it’s something I should lookout for while building my various 3d Printers designs.

    Anyway, I’ve checked the last commit in the Manga Screen repo and can see that the last change was on the 27-August. Is this what you where referring too?
    I’ll need to merge it into my Firmware version and give it a test. Will let you know how it goes.

    • Sorry, forgot to issue the “git push” command. Now it is there.

      When I got it to work with ubuntu, I had to read the debugging messages from the serial port in order for it to work. Without doing that it would hang. In order to fix that, I removed the debug-messages in the last commit, but did not get the chance to test it before it failed.

      But, no it was not in use with the replicape. Only plugged it into the BBB. I’m sure it was some static electricity from my fingers or something. Or maybe a bad solder joint somewhere. But I have no debugging equipment whatsoever where I am at the moment, so I have to wait until end of september before I figure it out.

      • Øyvind, have you gotten the display to work directly on BBB? I’m having some trouble with the power it seems.. I have not looked at this in a while, so I need to recap.

        Maybe you should order a new touch panel right away so you can get back to it?

        • The display works fine on BBB. I followed the instructions you sent me and it worked like a charm. Plug and play =)

          I don’t think the touch panel itself is the problem. The µC does not enumerate at all. Even after a reset. So I think the µC is the problem.

  6. Mmmh. So it’s in.

    But no pointer or touch capability. But that could be my install of lightdm, as it’s currently not showing any icons anyway.

    So it could be that I don’t have the correct drivers installed.

    I need to get a hub and connect it to the BBB so I can log in and see if it can see the screen as a touch device.

    • I used the factory default installation on BBB. Then ran the following commands that Elias sent me, and it worked:

      cd Replicape/kernel
      make angstrom

      I have both the USB and the HDMI from mangascreen plugged into BBB.
      I power up BBB, it takes a few seconds, and I see the splash screen and it starts. (Sometimes I have had to press the reset button after power-up to make it work. Not sure why..)

      I’m using the mangascreen revision A2.

      • Sorry, just realized that it was not the screen you were struggling with, but the touch.

        Did you get my latest git push?

        If so, try it on a laptop computer and see if it enumerates. (The touch interface is through USB, in case you didn’t know). Also test reading from the serial interface if it doesn’t work.

        • Yes I merged your latest, ttyACM0 appears and I can run most of the diagnostics, except the raport, which shows one page of events and then crashes.

          I don’t have a native pc linux box and do my linux dev on a vm image. Now for some reason the last push you made changed the usb hid in such a way that my windows box doesn’t forwarded the usb to the vm any more.

          Something else to investigate.

      • Yeah. I noticed that plugin in the screen while the bbb is up, the bbb does not power the usb port for some reason.

        Do a reset and it boots up and powers up the port. I’ve noticed that sometimes the bottom of the screen is corrupted during boot.

        Anyway, I’m using the kernel as above, but not seeing any recognized inputs detected by lightdm. I’ve tried ts_calibrate and it reports that it does not recognize the input devise.
        So going to look at the tslib library today, see if I can spot anything.

        The instructions on how to install ubuntu on the replicate wiki site suddenlt stop at the Xorg configuration. Suspect Elias got sidetracked.
        Also the modified source in the manga screen touch dir doesnt seem to be there.

        • Haha! I probably did:) ill look into it guys, sorry for being all over the place lately, I’ve been busy getting the extruder working.. I’ll look into it:)

  7. Hey,

    First of all great work!
    Nice to see someone taking the time to work on a custom piece of hard/software for the use of something that is needed for projects in general!
    One question though.
    You said you are working with the LQ043Y1DX07 panel, would the bord work with just the “stock” panel, or would any derivatives (Desire HD replacement screens) work as well?
    The latter would be great since they would be great cheap alternatives.

      • Great!

        I am planning on housing a Odroid-u2 in a PSP enclosure and need a fitting hdmi screen and this should work then!
        It all comes down on how cramped the components of the Manga could fit on a single board.
        I think i will look into it somewhere this week.

  8. I was looking around for various multi touch drivers and noticed that cando and ntrig do usb touch screens with related HID for linux.

    So instead of trying to get a synapic i2c driver working via usb, get the atmel to emulate/translate the mxt224 messages to ntrig or cando expected messages. That way we can leverage already build in drivers and all that is needed is to reverse enginneer the protocol expected from the available source code.
    There might even be a firmware some were for the atmel.

    What do you think? Doable?

  9. Hi,

    Firstly, nice work with the board I am very interested in making one.

    What made you choose the HTC Desire HD screen to use with this board?
    I’m just wondering, can the board be used or adapted to suit any other screens, perhaps lager ones or a cheaper variety.


    • Hi, The reason this screen was chosen was because it has a parallel RGB interface yet large enough resolution to fit within the lower limit of the TFP401 pixel clock pll which is about 25MHz. It might be possible to use an external clock from the micro controller or similar to lower the pixel clock and then get a lower resolution. If you can verify that the TFP401 does indeed work with a lower speed external clock and you can find a cheaper than the $16 LCD used here, then go for it : )

  10. Did you tweak the video on your Ubuntu kernel build to get working with the LCD? Reason I ask is that your build works with the screen, but a stock one does not.
    I’ve tried this also on a Cubieboard, and PCDuino and they both don’t display anything in Android and Ubuntu.

    Strangely it works with a stock Raspberry Pi build.

  11. Elias,

    This looks like great work!!! I’m interested in building this to test drive on my project. Do you have any PCBs already fabricated that I could use to build this… or could you point me in the right direction to have some made?



  12. hi, your project is very nice!!!

    i have one question. why do you insert eeprom(24LC04) in the A3?
    you said it can be used by atmega in the A2.
    thank you.

  13. hi, its very interesting.

    if it only use a 401(without eeprom and atmega), it operate?
    which peoblems have?
    i want to use only one because of money ^^.
    it is option in the 401 reference design.

    and i would like to use only atmega without eeprom like your version a2.
    but you inserted again the a3. why did insert?

    thank you.

    • Hi! The idea in Rev A2 was tom implement the EEPROM in software, but due to some badly chosen GPIO pins it became difficult to implement a software I2C protocol. It worked somewhat, but it was not stable enough to use in production. Also the EEPROM chips are very cheap so it’s not worth the trouble of making it in software..

  14. thank you for reply.
    eeprom can be write by HDMI cable?
    i want to know more information.
    i think it has a limitation. right?
    if i have a windows7 pc, can i program eeprom using HDMI?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>