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

    Hi mackrackit,

    No we haven't touched on them yet (CONFIGS). I have read a little about them, If I'm honest though at this stage or up to now if the programs compiled and run great.

    We will have to cover them soon though.

    A few jobs around the house then back on the display! It will work, I know it will (I think).

    Dave

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


    Did you find this post helpful? Yes | No

    Default

    UPDATE:

    I think the cct is wired up somewhere handy (non technical term). I was a bit unlucky in that I bought a ribbon cable for the job which had the finest wire inside I've ever seen, so had to solder some stiffer 'legs' on to all the wires which kept breaking off, grrr.

    The LCD still shows the same 2 dark lines when the pot is turned.

    I went for your PORTC option in the end mackrackit (@ DEVICE PICI6F684, MCLR_OFF wouldn't compile for one).

    One thing, as Henrik said earlier:
    I'm not 100% sure if the LCDOut commands automatically sets the TRIS registers for the Enable and RS bit of the LCD but it certanly doesn't hurt to do that "manually" just to be sure it's correct.
    Right now I'm not sure what to set the TRIS registers to for this.

    The only other thing I know I haven't done is transfer the GROUND - PIN2 - PIN2 from the PICKit1 (serin / out) to the LCD display.

    Ok, here's the program as it stands:

    Code:
    ANSEL   = %00000000    'Disable analog select so ports work as digital i/o.
    CMCON0  = %00000111    'Disable analog comparators.
    TRISA   = %00000000    'Set PORTA as OUTPUT.
    PORTA   = %00000000    'Set PORTA pins all low.
    TRISC   = %00000000    'Set PORTC as OUTPUT.
    PORTC   = %00000000    'Set PORTC pins all low.
    
    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
    
    DEFINE OSC 4
    
    NUM1 VAR BYTE
    OP VAR BYTE
    NUM2 VAR BYTE 
    TOTAL VAR BYTE
    
    MAIN:
    PAUSE 7000
    SEROUT2 PORTA.0, 16780, ["Please send NUM1", 10, 13] 
    PAUSE 500
    HIGH PORTA.5          'Shows data sent
    PAUSE 1000
    LOW PORTA.5
    
    PAUSE 250
    SERIN2 PORTA.2, 16780, [DEC NUM1]'MODE 16780 = 2400 BAUD INVERTED
    PAUSE 500
    HIGH PORTA.5          'Shows data arrived
    PAUSE 1000
    LOW PORTA.5
    
    PAUSE 250
    SEROUT2 PORTA.0, 16780, ["Please send Operator + - * /", 10, 13]  
    PAUSE 500
    HIGH PORTA.5          'Shows data sent
    PAUSE 1000
    LOW PORTA.5
    
    PAUSE 250
    SERIN2 PORTA.2, 16780, [OP] 'MODE 16780 = 2400 BAUD INVERTED
    PAUSE 500
    HIGH PORTA.5          'Shows data arrived
    PAUSE 1000
    LOW PORTA.5
    
    PAUSE 250
    SEROUT2 PORTA.0, 16780, ["Please send NUM2", 10, 13] 
    PAUSE 500
    HIGH PORTA.5          'Shows data sent
    PAUSE 1000
    LOW PORTA.5
    
    PAUSE 250
    SERIN2 PORTA.2, 16780, [DEC NUM2]'MODE 16780 = 2400 BAUD INVERTED
    PAUSE 500
    HIGH PORTA.5          'Shows data arrived
    PAUSE 1000
    LOW PORTA.5
    
    Select case OP
    CASE "+"
    TOTAL = NUM1 + NUM2
    CASE "-"
    TOTAL = NUM1 - NUM2
    CASE "*"
    TOTAL = NUM1 * NUM2
    CASE "/" 
    TOTAL = NUM1 / NUM2
    END SELECT
    
    pause 250
    SEROUT2 PORTA.0, 16780, [DEC TOTAL, 10,13]
    PAUSE 250 
    GOTO MAIN
    Last edited by LEDave; - 20th April 2010 at 23:52.

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


    Did you find this post helpful? Yes | No

    Default

    I've just transfered the GROUND - PIN2 - PIN3 from the PICKit1 (serin / out) to the PIC / LCD display.The program works on the pc serial communicator as before but doesn't show anything up on the LCD which is a shame.


    Dave

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


    Did you find this post helpful? Yes | No

    Default

    Maybe you should put something in your code to send data to the LCD??
    Code:
    LCDOUT $FE,1,"Hello World!"
    Dave
    Always wear safety glasses while programming.

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


    Did you find this post helpful? Yes | No

    Default

    LCDOUT $FE,1,"Hello mackrackit"
    It WORKED!!!!!!!!!!!!!!!

    Fantastic, what a buzz!

    Right I'm to bed now it's really late, really pleased with that

    Thanks for your help everyone.

    Dave
    Last edited by LEDave; - 21st April 2010 at 01:28.

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


    Did you find this post helpful? Yes | No

    Default

    The display's looking good

    I guess I should do some reading on LCD characters '$FE,1,' etc and figure out how they work.

    Absolutely brilliant to see it actually come to life late last night.

    Thanks again to everyone.

    David

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


    Did you find this post helpful? Yes | No

    Default

    To have a little fun check this out
    http://www.picbasic.co.uk/forum/showthread.php?t=242
    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