12f675_fuse_about_to_blow!


Closed Thread
Results 1 to 40 of 929

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    .....................
    Last edited by LEDave; - 20th April 2010 at 09:46.

  2. #2
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi Henrik

    Here's what I'd come up with late last night (I wish I'd posted it now before I went to bed as not the far off I don't think).

    Code:
    DEFINE LCD_DREG PORT.A        ' Set LCD Data port
    DEFINE LCD_DBIT 0             ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORT.A       ' Set LCD Register Select port
    DEFINE LCD_RSBIT 4            ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTC         ' Set LCD Enable port
    DEFINE LCD_EBIT 0             ' Set LCD Enable bit
    DEFINE LCD_BITS 4             ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 4            ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2000     ' Set command delay time in us
    DEFINE LCD_DATAUS 50
    I set LCD_LINES 4 as the display is a 4*20.

    The one I'm missed was LCD_EBIT 0 (it was late).

    Also the PIC is a 16F684 PORTA and PORTC

    Thank you for taking the time to do go through it all though (really appreciated) I'll load it later today and hopefully have some success (I'm just a little worried I've fried the LCD).

    David
    Last edited by LEDave; - 20th April 2010 at 10:03.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,626


    Did you find this post helpful? Yes | No

    Default

    Hi Dave,
    Ah, OK - I never crosschecked with the PIC datasheet, I only referenced your proposed connection scheme and LCD datasheet. So, PORTA and PORTC it is.

    One thing though, there's not supposed to be dot in PORT.A it's just PORTA. The thing with DEFINEs is that they won't produce any error messages etc so you have to make sure you write them correctly or it simply won't work properly.
    Last edited by HenrikOlsson; - 20th April 2010 at 10:42.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    PORTA.3 is input only so you will need to move this over to portC.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    How about doing it like this. The whole thing will be on PORTC. That will keep away from the MCLR and programming and POT(if still using the PICKIT1) pins.
    Code:
    DEFINE LCD_DREG     PORTC 'PORTC.0 WILL CONNECT TO DB4, PORTC3 TO DB7
    DEFINE LCD_DBIT     0
    DEFINE LCD_RSREG    PORTC
    DEFINE LCD_RSBIT    4          'PORTC.4 CONNECT TO LCD PIN4
    DEFINE LCD_EREG     PORTC
    DEFINE LCD_EBIT     5            'PORTC.5 CONNECT TO LCD PIN6
    DEFINE LCD_BITS     4
    DEFINE LCD_LINES    4
    DEFINE LCD_COMMANDUS 2000     
    DEFINE LCD_DATAUS 50
    LCD pins
    1 and 5 to VSS
    2 to VDD
    3 to wiper on POT
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Hi mackrackit,

    I've moved the whole thing over to the breadboard and wired it on there.

    A couple of quick things:

    Yes the manual shows a 10k res on MCLR, I've put one on PORTA.3 which probably isn't a good idea.

    I've checked the voltage on the display itself earlier:

    Across pin 1-2 = 4v (with pin 1 as GND)
    Across pin 1-3 = it goes from 0 - 3.94v
    Across pin 2-5 = 3.92v

    Also (I've just noticed this) when I turn the POT, the top and third line of the display get darker, so something's going on or trying to.

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I would turn MCLR off then you can use that pin as an input.

    Display sounds like it is alive
    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts