PIC16F84A using pulsout and TMR0


Closed Thread
Results 1 to 33 of 33

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Do you have DEFINE LCD_COMMANDUS 1000 in your code? If that's the case try increasing that to 2000 to start with. If that doesn't help put a PAUSE 500 right at the beginning of the program, that will let the LCD startup for sure.

    If that doesn't help either, increase the COMMANDUS and DATAUS defines. Test with 10000 for COMMANDUS and 500 for DATAUS just to see if it helps. If it works, try to find the sweetspot just over where it stops working.

    /Henrik Olsson.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HenrikOlsson
    Hi,
    Do you have DEFINE LCD_COMMANDUS 1000 in your code? If that's the case try increasing that to 2000 to start with. If that doesn't help put a PAUSE 500 right at the beginning of the program, that will let the LCD startup for sure.

    If that doesn't help either, increase the COMMANDUS and DATAUS defines. Test with 10000 for COMMANDUS and 500 for DATAUS just to see if it helps. If it works, try to find the sweetspot just over where it stops working.

    /Henrik Olsson.

    Unless PBP has been fixed, I seem to remember that the DATAUS define was actually a byte define. In other words, if you specify DATAUS 257, it'll actually come out to be DATAUS 1. I could be wrong. The COMMANDUS is still a word define. I'll check a .lst file when I get home tonight to confirm that.
    JDG

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


    Did you find this post helpful? Yes | No

    Default

    Hi Skimask,
    Thank you! I didn't know about that. Please let us know what you find out!

    /Henrik Olsson.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HenrikOlsson
    Hi Skimask,
    Thank you! I didn't know about that. Please let us know what you find out!

    /Henrik Olsson.


    I just checked it out.
    If you look in any .lst file that contains any LCD defines or usage, you'll see that the LCD_COMMANDUS is a word variable internal to PBP and, as I suspected, LCD_DATAUS is a byte variable internal to PBP. So, you can't use anything higher than 255 in LCD_DATAUS.
    Another thing to be changed in upcoming PBP manuals...
    JDG

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    well, i've NEVER use a higher value than 100uSec (50uSev typical) on those various LCD i work and i worked. I don't believe there's some on the market that will really need more than 100 uSec.

    If the LCD show only Black square it's because it fail to initialise properly or the contrast is set to max.

    Reasons to fail:
    • Too short startup delay, some may need up to secondes... try PAUSE 2000, if it works, reduce it 'till you find a comfort zone
    • Some wires are swapped between them
    • In 4 bit mode, you must use DB4, db5, db6,db7.... AND some model need to send unused pins somewhere gnd or VDD, check the datasheet
    • the R/W is not connected to GND
    • you're using RA.4 without pull-up resistors
    • your supply line is poor and noisy
    • you're using a xtal>4 MHZ and you didn't set HS config fuse
    Last edited by mister_e; - 9th December 2006 at 10:44.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    Hi,
    Thanks for verifying that Skimask!

    Steve, you are most certanly right about the timing, no LCD should need more than 100uS for data. But my advice of trying with 500 was not a very good one since I didn't know of the 8-bit clamp.

    All valid points from you Steve, Dragonballs problem seems to be timing related since it works when he's using a slower clock than 4Mhz. But at 4Mhz it seems to skip the first characters, if I understood it correctly.

    /Henrik Olsson.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HenrikOlsson
    Hi,
    Thanks for verifying that Skimask!

    Steve, you are most certanly right about the timing, no LCD should need more than 100uS for data. But my advice of trying with 500 was not a very good one since I didn't know of the 8-bit clamp.

    All valid points from you Steve, Dragonballs problem seems to be timing related since it works when he's using a slower clock than 4Mhz. But at 4Mhz it seems to skip the first characters, if I understood it correctly.

    /Henrik Olsson.


    I think the 500 idea was good enough since 500-256=244. Should be more than enough for a data delay...
    Put a 5 second pause at the beginning of the program, that'll extinguish any doubt about the power up on the LCD. If that don't fix it, it's something else.
    JDG

Similar Threads

  1. Pin won't stay high during Repeat...Until loop??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th August 2009, 23:57
  2. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  3. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 07:12
  4. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 04:52
  5. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35

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