LCD BARgraphs


Closed Thread
Results 1 to 40 of 233

Thread: LCD BARgraphs

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    The LED is on portb.2. Portb is set as all outputs except bit 1. See the trisb=1

    So, where is the ... Tadaaa?? :-)

    Ioannis

    No tadaaaaaa ... just read a bit too quickly ( TRISx = %00000001 is so much easier to look at ...)

    Strange ... i tried DT interrupts quite the same way ... no problems.
    Last edited by Acetronics2; - 26th June 2007 at 12:36.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    I think I am,

    trisb=1 is equal to:

    trisb=%00000001

    Isn't this bit 0 of port b set as input?

    Ioannis

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Looks good ...

    I tried THAT in MPSIM ... Works Great ...




    INCLUDE "C:\PBP\MODEDEFS.BAS"
    DEFINE OSC 4

    INCLUDE "DT_INTS-14.bas" ; Base Interrupt System
    INCLUDE "ReEnterPBP.bas" ; Include if using PBP interrupts

    LED1 VAR PORTB.2

    trisa=1:trisb=1:trisc=0:trisd=0:trise=0
    PORTA=0:PORTB=0:PORTC=0:PORTD=0:PORTE=0

    OPTION_REG = %00100001 ; Set TMR0 Prescaler to /2, RBPU on

    adcon0=%10000000 'Fosc/32, ADC ON
    adcon1=%10001110 'Right Justify, RA0 Analog, rest Digital I/O

    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    INT_Handler INT_INT, _ToggleLED1, PBP, yes
    endm
    INT_CREATE ; Creates the interrupt processor

    INT_ENABLE INT_INT ; enable external (INT) interrupts
    ENDASM

    Main:
    pause 1
    GOTO Main

    '---[INT - interrupt handler]--------------------------------------------------
    ToggleLED1:
    high LED1: pause 100:low led1
    @ INT_RETURN


    I just modified OPTION_REG value cause little things seemed strange to me ...

    try it ... huuu ... is processor a 16F877 ????

    Alain
    Last edited by Acetronics2; - 26th June 2007 at 13:02.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Yes Alain, MCU is 16F877, but this is minor.

    Do you mean that with OPTION_REG=$81 does not work also at your test?

    I have not the board with me at work now. I will test it late today.

    Ioannis

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    I have an old 877 here...

    I'll breaboard it ...

    We'll see !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Smile Original Code is OK

    Hi, Ioannis

    YOUR code has passed the Breadboard test ...

    Works as expected ... ( little flash when PORTB.0 tied to ground )

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Looking at the PICDEM2+ schematic some more, it seems that there might be a conflict with PORTB.0

    <img src=http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1794&stc=1&d=118289364 1>

    With J6 installed (has to be for the LED on PORTB.2), the LED on PORTB.0 may not allow the voltage to rise far enough to register a HIGH level.
    <br>
    Attached Images Attached Images  
    DT

  8. #8
    Join Date
    Jan 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Thumbs up AWESOME!!!!! (again)

    I joined in this quite late, but on the original bargraph code posted by Darrel (and also the interrupt code posted elsewhere) I have one thing to say....WOW Darrel. GENIUS.. BOTH of these snippets have saved me hours of work on a project I'm working on.

    I needed to poll an array of front panel switches every few milliseconds AND service a bargraph update AND change the frequency of a HPWM signal all at set times, I was in the process of writing an RTOS for the PIC to allow me to use queued commands executed on a priority/time basis, then these two pieces of code went live.

    OK, you killed my six months of work on the RTOS, but I'm not complaining. Everytime I see a new posting by you I just KNOW it's gonna be soething that makes my life that little bit easier.

    A huge thanks and keep up the excellent work.

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

Members who have read this thread : 2

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