Serial UART and Interupts on a 16F87X


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Posts
    15

    Default Re: Serial UART and Interupts on a 16F87X

    Ok, I got off on a different project for a while. Now to pick this up again! Lets see if I can get my head around this and remember where I was at.

  2. #2
    Join Date
    Aug 2011
    Posts
    15

    Default Re: Serial UART and Interupts on a 16F87X

    Yes, this seems to work! I need to check one other thing before I sign this off. But I left some of my notes at work. So I will check the last thing tomorrow morning.

    Can someone answer what the .0 is for or how it behaves in the line:
    IF relay = 1 THEN CW = Stat.0 ' Process relay#1
    IF relay = 2 THEN CCW = Stat.0 ' Process relay#2

    I understand the "stat" part, but not seeing what .0 function is.

    Thank you
    Scott

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

    Default Re: Serial UART and Interupts on a 16F87X

    Stat VAR BYTE 'relay status ON/OFF variable
    8 bits in a byte -- 0 to 7

    IF relay = 1 THEN CW = Stat.0 ' Process relay#1
    Stat.
    0 is the first bit of byte Stat

    From the PBP manual
    4.4. Aliases
    VAR can also be used to create an alias (another name) for a variable. This is most useful for accessing the innards of a variable.

    fido var dog ' fido is another name for dog
    b0 var w0.byte0 ' b0 is the first byte of word w0
    b1 var w0.byte1 ' b1 is the second byte of word w0
    flea var dog.0 ' flea is bit0 of dog
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Aug 2011
    Posts
    15

    Default Re: Serial UART and Interupts on a 16F87X

    Ok! It is all good. Thanks to all that helped me get a handle on this. Makes sense, and I see why it did not work early on, and understand what I did wrong.

    Thanks,

    Scott

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