Best way to use USART/HSERIN


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Best way to use USART/HSERIN

    Check the Lab X1 schematic, I'm pretty sure there was a jumper for this. It handled all the LEDs at once.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Best way to use USART/HSERIN

    Quote Originally Posted by Demon View Post
    Check the Lab X1 schematic, I'm pretty sure there was a jumper for this. It handled all the LEDs at once.
    Is this what you're referring to Robert?
    LED Bargraph

    8 programmable LEDs connected to PORTD and 2 power LEDs are provided by
    the LED bargraph. Resistor pack RP4 provides the current limit series
    resistors for the LEDs. The LED bargraph may be inserted in the socket so
    that the LEDs are lit when the PICmicro MCU pin is in either its high or low
    state.

    To make the LEDs light up when a PICmicro MCU pin is high, insert the LED
    bargraph into the socket with pin 1 toward the edge of the board (this will
    also line it up with pin 1 on the socket and is the default placement).
    Jumper JP2 must have pins 2 and 3 connected (jumper on the top 2 JP2 pins).
    When the LAB-X1 is powered up, the leftmost LED will light up to show that
    power is on. To make an LED light up, set the appropriate PORTD pin to
    output high.

    To make the LEDs light up when a PICmicro MCU pin is low, insert the LED
    bargraph into the socket with pin 1 toward the center of the board. Jumper
    JP2 must have pins 1 and 2 connected (jumper on the bottom 2 JP2 pins). When
    the LAB-X1 is powered up, the second to the leftmost LED will light up to
    show that power is on. To make an LED light up, set the appropriate PORTD
    pin to output low.

    The LED bargraph shares PORTD with the LCD module data lines. If the
    program is not using the LCD module, it can effectively be ignored. If the
    LCD module is also being used, it may leave the LEDs in a different state
    than it found them in. If the LCD is operating on a 4-bit data bus, only the
    top 4 LEDs, 4 - 8, will be affected. If the LCD is using an 8-bit data bus,
    all 8 LEDs will be affected. The proper LED state will need to be reset
    after each LCD access.

    See BLINKX.BAS for a programming example.
    I'll check the jumpers tonight, but it seems like it's an all-or-nothing thing - on my board, the leftmost LED lights up when powered on and the ERROR LED from my code does blink, but a few of the other ones are always on.

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Best way to use USART/HSERIN

    Yup, JP2, that's the one.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Best way to use USART/HSERIN

    Looking at the board with the power jack on the left and the 16F8777A on the bottom, the JP2 jumper has the top two pins tied together. The LED bargraph has the writing towards me. That would seem to be the pick-pin-HIGH-LED-On scenario described above, so I don't get why the LEDs which aren't referenced are on. <Sigh>

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Best way to use USART/HSERIN

    Dumb question, did you assign initial values to the pins, ADC, CONFIGs, etc?

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: Best way to use USART/HSERIN

    Not a dumb question, Robert - I did not. Think I should add 'PORTD =0'?

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Best way to use USART/HSERIN

    I'd use the variables.

    Why the renaming?

    led1 var PORTD.1
    led2 var PORTD.2
    led7 var PORTD.7

    ERROR_LED VAR led7 ' rename the LED's
    LATE_LED VAR led2t
    HEART_LED VAR led0

  8. #8


    Did you find this post helpful? Yes | No

    Default Re: Best way to use USART/HSERIN

    Problem solved:

    Code:
    ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    '   Variable definition
    ':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    
    ERROR_LED  VAR PORTD.1            ' rename the LED's
    LATE_LED   VAR PORTD.2
    HEART_LED  VAR PORTD.0
    
    PORTD = 0

Similar Threads

  1. USART to PC
    By tonyfelloni in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th October 2008, 00:09
  2. Usart
    By lew247 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 2nd June 2008, 23:41
  3. Sharing a USART
    By Ron Marcus in forum Serial
    Replies: 1
    Last Post: - 7th September 2005, 14:48
  4. 9 bit addressable USART
    By barkerben in forum General
    Replies: 9
    Last Post: - 4th January 2005, 22:57

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