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. g0th

    g0th What's a Dremel?

    Joined:
    12 Apr 2005
    Posts:
    319
    Likes Received:
    1
    Scorpia, could you please compile the code for a PIC18F4550, and upload the hex for me? I have a PIC18F4550 on hand, and i'd like to try this out. You can leave the port pin assignments the same.

    Cheers.
     
  2. bubsterboo

    bubsterboo What's a Dremel?

    Joined:
    24 Jan 2006
    Posts:
    800
    Likes Received:
    3
    ^ Same, if i could get the compiled code for the PIC18F4550 that would be great. Thx.
     
  3. HellraiserUK

    HellraiserUK What's a Dremel?

    Joined:
    19 Sep 2006
    Posts:
    11
    Likes Received:
    0
    Just had a look at the schematic for this whilst figuring out a stripboard layout and I am confused - what are the BL+ and BL- pads for?

    Cheers

    Hellraiser............>
     
  4. Scorpia

    Scorpia What's a Dremel?

    Joined:
    17 Jul 2006
    Posts:
    62
    Likes Received:
    0
    they are to run the backlight on the screen, Not all screens have a backlight so yours may not have it.

    Scorpia
     
  5. g0th

    g0th What's a Dremel?

    Joined:
    12 Apr 2005
    Posts:
    319
    Likes Received:
    1
    You shouldn't have to change the code much to change the device - i don't think.

    I actually know next to nothing about programming these devices.

    You could probably try just changing the device definition in the start of the program - the flag which tells the programmer software what device it is dealing with.
     
  6. GuardianStorm

    GuardianStorm Minimodder

    Joined:
    26 Apr 2005
    Posts:
    1,475
    Likes Received:
    1
    assuming the ports on the two devices are the same, all Ch242 would have to do is change the #include statement to the 4455 header rather than 2550.
     
  7. ch424

    ch424 Design Warrior

    Joined:
    26 May 2004
    Posts:
    3,112
    Likes Received:
    41
    It took me about an hour to strip out all the 18F4550 stuff... when I'd never used C for programming PICs before. So I guess some you you people could do it pretty quick.

    All I did (iirc) is get rid of/redefine any references to PORTD or PORTE, and replace the linker and include files to use the 18f2550 versions.

    Sorry I haven't been too helpful, I'm really busy at the moment.

    ch424
     
  8. Scorpia

    Scorpia What's a Dremel?

    Joined:
    17 Jul 2006
    Posts:
    62
    Likes Received:
    0
    Had a quick go at changing to a 4550.

    I have changed the .h and the .lkr files and changed any includes from 18f2550 to 18f4550.

    Also i had modified the USB description so try the new .inf file as well. ( the old one will still work) All functioning code is the same as CH424 code.

    USB-LCD.inf

    USB-LCD-18f4550.hex.txt

    USB-LCD.hex.txt (18f2550 with changed usb descriptions.)

    rename the .txt to .hex

    i havnt changed any pin id's or anything so please give it a shot and let me know how it goes.
    I dont have an 18f4550 so i cant test it. g0th if you have a spare maybe i can swap a 18f2550 for one.

    Scorpia
     
    Last edited: 1 Oct 2006
  9. HellraiserUK

    HellraiserUK What's a Dremel?

    Joined:
    19 Sep 2006
    Posts:
    11
    Likes Received:
    0
    Don't suppose anyone can knock me up a PCB can they? For some reason my stripboard version doesn't work (beeper goes off when connected to USB, but PC doesn't recognise that anything has been connected), everything seems right going by the circuit. Reprogrammed the PIC, checked and double checked all the config settings for it, used another PIC, same.

    Bloody stripboard :(

    Hellraiser.............>
     
  10. Scorpia

    Scorpia What's a Dremel?

    Joined:
    17 Jul 2006
    Posts:
    62
    Likes Received:
    0
    Hellraiser,

    i would try disconnecting the LCD and associated compoments. also remove the transistors that run the buzzer and the brightness.

    once you have done that the PIC should be basicly by itself. once that is the case see if windows detects the pic then.

    If so add the other components one at a time and see what happens

    Scorpia
     
  11. HellraiserUK

    HellraiserUK What's a Dremel?

    Joined:
    19 Sep 2006
    Posts:
    11
    Likes Received:
    0
    Makes sense :) Will have another go the weekend if/when I get chance! I presume it won't break anything running the chip without half of the other stuff? I'd already disconnected the LCD to no avail...

    Cheers

    Hellraiser..............>
     
  12. HellraiserUK

    HellraiserUK What's a Dremel?

    Joined:
    19 Sep 2006
    Posts:
    11
    Likes Received:
    0
    Makes sense :) Will have another go the weekend if/when I get chance! I presume it won't break anything running the chip without half of the other stuff? I'd already disconnected the LCD to no avail...

    Cheers

    Hellraiser..............>
     
  13. Scorpia

    Scorpia What's a Dremel?

    Joined:
    17 Jul 2006
    Posts:
    62
    Likes Received:
    0
    opps doubleup.
     
    Last edited: 4 Oct 2006
  14. Scorpia

    Scorpia What's a Dremel?

    Joined:
    17 Jul 2006
    Posts:
    62
    Likes Received:
    0
    Hellraiser,

    Check your wiring, it looks like there is no ground or power connected to the PIC in the schemetic. it is connected on the PCB layout.

    Also the PIC should run up with just r1, c1-6, x1 and the usb connector components.

    See if that helps

    Scorpia
     
    Last edited: 4 Oct 2006
  15. ch424

    ch424 Design Warrior

    Joined:
    26 May 2004
    Posts:
    3,112
    Likes Received:
    41
    I thnk the code is written such that it will only connect to the USB if the LCD is working, so disconnecting the LCD won't help at all. The fact that the buzzer is buzzing suggests that there's something badly wrong with the chip, the program or the config bits.
     
  16. alig

    alig What's a Dremel?

    Joined:
    16 Aug 2006
    Posts:
    5
    Likes Received:
    0
    No, it isn't. When you connect it to computer, it first intializes the USB connection and then the LCD and the other things. As Scorpia said, the PIC can run only with r1, c1-6, x1 and the usb connector components.

    Btw Soon I will make a PCB and I'll see if it is going to work better


    Regards
     
  17. ch424

    ch424 Design Warrior

    Joined:
    26 May 2004
    Posts:
    3,112
    Likes Received:
    41
    :duh: Ooops, my bad. It only turns the backlight on once it's connected to the computer.
     
  18. HellraiserUK

    HellraiserUK What's a Dremel?

    Joined:
    19 Sep 2006
    Posts:
    11
    Likes Received:
    0
    Hmmm, well that's a help, does much more when the PIC gets power :) No display/backlight yet, but will investigate further, at least it is picked up by XP now!

    ch424, might be an idea to update the schematic with pins 8, 19 and 20, save anyone else using stripboard from getting frustrated :)

    Hellraiser...........>
     
  19. HellraiserUK

    HellraiserUK What's a Dremel?

    Joined:
    19 Sep 2006
    Posts:
    11
    Likes Received:
    0
    Now this is weird. Still no display, but the backlight works - only problem is according to the spec for the display pin 16 is for backlight GND and pin 15 is for +5v - connected like this the backlight does not work. Swapping the 2 pins the backlight works fine, and even switches on/off under software control. Still no display, most confused..... :confused: :confused: :confused:

    Hellraiser.............>
     
  20. Scorpia

    Scorpia What's a Dremel?

    Joined:
    17 Jul 2006
    Posts:
    62
    Likes Received:
    0
    sounds like your almost there. The LCD backlight is software controlled via the PIC, so it seems to be running ok.

    remember that the display wont display anything until you send it something over the serial link.

    make sure your running LCD smartie or a similar program.

    If your unsure you can allways use hyperterm and just type some stuff. Any baud rate should be ok but try and use 56k or 115k they seem to work the best.

    Also you will probably need to adjust the contrast pot to get a display on the LCD.

    Thanks

    Scorpia

    EDIT : just reread what you typed and saw that you said the software control works for the backlight so i figure your running the software.

    Does the LCD display do anything? if you just apply power most lcd's come up with the first row as black squares (without the pic connected.). Do that to adjust the contrast. i found that the contrast port needs to be almost turned all the way to one side. i cant remember what side as im at work.
     
    Last edited: 5 Oct 2006
Tags:

Share This Page