1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Guide Make your own USB LCD controller!

Discussion in 'Modding' started by ch424, 23 Jun 2006.

  1. thaimin

    thaimin What's a Dremel?

    Joined:
    24 Apr 2009
    Posts:
    40
    Likes Received:
    1
    That LCDGoto looks like it is from the original ch424 code, not my code (I don't have a global gototemp variable, and my function LCDCommand is called WriteCmdXLCD). It is however functionally identical to my function.

    Here is a modified, easier to understand, version:

    Code:
    void LCDGoto(byte col, byte row) {
    	byte cmd = 0b10000000; // command for set position
    	switch (row){
    	case 1 : cmd +=  0; break;
    	case 2 : cmd += 64; break;
    	case 3 : cmd += 20; break;
    	default: cmd += 84; break;
    	}
    	WriteCmdXLCD(cmd+(col-1));
    }
    Where the values 0, 64, 20, and 84 are the memory offsets of each line of the display. Based on what you said earlier, your offsets are probably 0, 64, 16, and 80 (64+16). Tell me if this works. My new system may have the ability to switch between different display types (still testing) so if this works, I will add this as a display type.

    Yeah, I guess the contrast PWM update is quite fast, I forgot about that. It works great during transitions (I only use contrast fade transitions). So I guess the bit of math that I do to optimize is quick. I do remember working a lot on all the PWM code to make it as awesome as possible (for example ch424's PWM code rounds the value to one of 8 different levels but mine has 254 different levels).

    BL and CT are separately sent from computer to USB2LCD+. The BL, CT, and GPO PWM are updated together every USB process cycle (which slows down a little during any USB operation or actually any processing on the chip).
     
  2. Kikero

    Kikero What's a Dremel?

    Joined:
    18 Jul 2010
    Posts:
    4
    Likes Received:
    0
    Hello,

    I constructed the board from http://www.coderforlife.com/projects/lcd/

    The display and the inputs works fine, but i cannot control the OUTPUTS. I connected LEDs to one of the outputs. When I plug on the LCD, the LEDs are always on. How can I switch off the LEDs with LCDSmartie?
     
  3. thaimin

    thaimin What's a Dremel?

    Joined:
    24 Apr 2009
    Posts:
    40
    Likes Received:
    1
    Have you tried setting them using LCD Setter available on that page? That will tell you if they are working. In LCDSmartie you send special characters with $Chr(). All commands are sent with a 254 character followed by the command code. The commands are listed on that website under "Using Custom Commands." An example to turn off GPO 2 is:

    $Chr(254)$Chr(86)$Chr(2)

    Hope it works!
     
  4. Kikero

    Kikero What's a Dremel?

    Joined:
    18 Jul 2010
    Posts:
    4
    Likes Received:
    0
    Thank you for answer, thaimin.

    Using LCD Setter there happens nothing (outputs/LEDs still on) when I edit the GPOs.
    Same situation in LCDSmrtie: the commands effect nothing, I can't switch off the outputs.

    Has the firmware an error? I don't know.
     
  5. thaimin

    thaimin What's a Dremel?

    Joined:
    24 Apr 2009
    Posts:
    40
    Likes Received:
    1
    I don't believe the firmware has an error since this works for me. How have you connected the outputs? To the high-power ones (they have a transistor) or the low power ones (they don't have the transistor)? Truthfully, I never got around to making the board posted there and it's still on a breadboard. Looking at my breadboard I have only 1 high powered one, and for some reason I put a resistor between the transistor and ground (where it goes straight to ground in the pictured circuit). I am currently moving so I can't test if that makes a difference at the moment, but I will soon.

    Try using the other type of output and see if it makes a difference. If so, then there is probably a problem with the circuit.
     
  6. Kikero

    Kikero What's a Dremel?

    Joined:
    18 Jul 2010
    Posts:
    4
    Likes Received:
    0

    I tried out both types of outputs. They (all outputs) are always on.
    But I seem to have three high-power ones. LEDs that I connect to the these outputs look all brighter than the other LEDs (low-power outputs).
     
  7. thaimin

    thaimin What's a Dremel?

    Joined:
    24 Apr 2009
    Posts:
    40
    Likes Received:
    1
    Yes, the PCB I designed has 3, my personal breadboard has only 1. It doesn't matter, they are interchangeable. And higher power means more current (I=P/V), and since LEDs are current devices and not voltage devices, more current means brighter. In fact on the higher power ones, the LEDs are pulling straight from the USB hub on the computer instead of going through the LCD controller. To make sure your LEDs have a nice long life, you may want to use a current limiting resistor (see: http://www.sciencebuddies.org/science-fair-projects/project_ideas/Elec_p037.shtml). The LCD controller requests 150mA, but the computer could provide 500mA or more. LEDs only like ~20mA. Remember that the chip and LCD divert a lot of the current.

    Anyways, enough of the physics lesson.

    About the problem. I have no idea. Mine works, and I am using the firmware from the website. The only thing I can think is that there is a difference between the breadboard and the circuit I put on the website, although I have checked it a few times and they seem to be the same circuit, and others haven't complained (but maybe they didn't use the outputs).

    Did you set all the chip configuration like in this picture: http://www.coderforlife.com/projects/lcd/config.png ?

    Did you use the bootloader?

    Are you willing to try some programming to find the error?
     
  8. dj_gonzy

    dj_gonzy What's a Dremel?

    Joined:
    9 Aug 2010
    Posts:
    2
    Likes Received:
    0
    project done

    Hi all,

    I successfully built the project from http://www.coderforlife.com/projects/lcd/, everything works fine.

    There are several problems with application lcd-setter, which was made for 16 bit OS version. Jeff tries to change to work on 32 bit.

    Here are some pics:
    [​IMG]

    Uploaded with ImageShack.us
    [​IMG]

    [​IMG]


    I have another VFD display, from an HP plotter, I don't know how to drive it. I think he uses an SPI interface, the pins are

    1: Vcc
    2: Clock
    3: GND
    4: Data
    5: Reset
    datasheet

    http://s89402622.onlinehome.us/vfd/us202sd01ad.pdf

    and pics:

    [​IMG]

    [​IMG]


    Can someone help me to connect the VFD to my PC?

    Kind regards,
    Cristian
     
    Last edited: 17 Aug 2010
  9. dj_gonzy

    dj_gonzy What's a Dremel?

    Joined:
    9 Aug 2010
    Posts:
    2
    Likes Received:
    0
    what transistors did you used

    Mine GPOs work ok.
    With lcd-setter you must set the GPO on/off and press "set current LCD..." or "set LCD mem...."
    What transistors diud you used ?
     
  10. Kikero

    Kikero What's a Dremel?

    Joined:
    18 Jul 2010
    Posts:
    4
    Likes Received:
    0


    I used 547B transistors.
     
  11. thaimin

    thaimin What's a Dremel?

    Joined:
    24 Apr 2009
    Posts:
    40
    Likes Received:
    1
    Hi all, I just wanted to say that I have updated the LCD-Setter and LCD-Smartie driver due to some problems working with variability in the registry. Anyone who was getting errors about no devices, this should be fixed now.
     
  12. Rorix

    Rorix What's a Dremel?

    Joined:
    21 Aug 2009
    Posts:
    10
    Likes Received:
    0
    i just remade my usblcd and found something weird on my lcd screen
    i added some special functions into my pic but whenever i start lcdsmartie everything starts fine but i notice 2 weird chars on each row a "G=" and those cannot be removed so im wondering if anyone else is getting this , and everything else runs as its supossed to

    thought it was my lcd so i wrote a new prog to test it and everything works damn fine
    maybe my lcdsmartie is playing some mind tricks on me

    a pic to explain it
    [​IMG]
     
    Last edited: 13 Oct 2010
  13. thaimin

    thaimin What's a Dremel?

    Joined:
    24 Apr 2009
    Posts:
    40
    Likes Received:
    1
    What were your new 'special functions'?
     
  14. Rorix

    Rorix What's a Dremel?

    Joined:
    21 Aug 2009
    Posts:
    10
    Likes Received:
    0
    a little message before activating lcd smart or opening the port for data transfer

    also some other special functions like controlling some fans via PWM , everything works great except for that trash character showing in the lcd

    im thinking its being sent by lcdmsmartie i think ill have to try some other apps
     
  15. thaimin

    thaimin What's a Dremel?

    Joined:
    24 Apr 2009
    Posts:
    40
    Likes Received:
    1
    If it is really being sent by LCD Smartie, then you are probably not processing all the commands it is sending. You should make sure you process at least all the commands on the first page of this thread. Also, you need to add a few extra commands that you just throw away the data for. Like contrast.
     
  16. zooyork

    zooyork What's a Dremel?

    Joined:
    31 Mar 2011
    Posts:
    2
    Likes Received:
    0
    failure

    Hi guys, I'm new in this forum. I've just built this great USB LCD controller. I programmed the PIC, it was verified and the wiring is also seems good, but when I plug in the USB I got an error message (USB device not recognised). I thought there is some mistake in the configuration bits, but those settings are same like ch424 posted on the first page. What could be the mistake, where should I look around.

    Thanks for you help, graetz from Hungary
     
  17. thaimin

    thaimin What's a Dremel?

    Joined:
    24 Apr 2009
    Posts:
    40
    Likes Received:
    1
    @zooyork
    This is typical of a bad wiring... make sure that all of the wires going to the LCD are approximately the same length and not too long. And just double check all connections.
     
  18. zooyork

    zooyork What's a Dremel?

    Joined:
    31 Mar 2011
    Posts:
    2
    Likes Received:
    0
    Thank you for the quick response. I'll check the wiring again.
    I guess the LCD connections shouldn't be involved with the USB. I haven't insert the LCD and the rotary yet. I think windows should recognise the device without any peripheries. Is it right?
     
  19. thaimin

    thaimin What's a Dremel?

    Joined:
    24 Apr 2009
    Posts:
    40
    Likes Received:
    1
    That's wrong. The rotatory is not necessary, but the LCD is. The firmware on the chip freezes if it cannot communicate with the LCD. When the firmware freezes, the USB connection freezes, which causes Windows to complain. Thus the LCD is necessary to get the USB connection to work. The firmware could be designed to work without the LCD, but I have tried to think of a simple way to do it, and it isn't simple. Since it doesn't make sense to have no LCD in the final circuit, it wasn't worth the effort it would have taken.
     
  20. vali_ave

    vali_ave What's a Dremel?

    Joined:
    20 Apr 2011
    Posts:
    9
    Likes Received:
    0
    Hi all.
    I'm having trouble with the original project. (PIC18F2550-no rotary)
    The device is recognized by win XP but the LCD shows only the first and third lines (4x20 LCD).
    When i try to use LCDSmartie (matrix.dll+comx,9600) the first and third line start to flicker when there is a change in the send text.
    Any ideas?
     
Tags:

Share This Page