18F1320 And I/0


Results 1 to 4 of 4

Thread: 18F1320 And I/0

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    OK, you're a BS2 converted now

    PIN is not valid in PBP. To write to a specific I/O you must use the according name. Something like PORTA.0=1

    You can also use an alias

    LED1 var PORTA.0

    then later you use LED1=1

    You can also use HIGH and LOW with a pin#

    SEROUT and some other MAY work using a pin # but it's really not readable later ( let's say HIGH 8 ... what the hell is 8? yeah it's PORTA.0... few minutes later ) I suggest you use the I/O name or an alias to the I/O

    Code:
    ROMDATA VAR Byte(32)
    i can't confirm it will work as is, usually we use
    Code:
    ROMDATA VAR Byte[32]
    Just change your parenthesis to square bracket. Same thing when you want to read/write to a specific Array
    Code:
    ROMDATA[0]=123
    As you're using a PIC with an internal USART, there's no need to use SEROUT/SEROUT2, use HSEROUT instead if your hardware permit. Better IMHO


    HTH
    Last edited by mister_e; - 10th December 2006 at 20:25.
    Steve

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

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