X-10 and the proper XOUT statement for 18F2620


Closed Thread
Results 1 to 8 of 8

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    TRISA is nice for safety sake, what i'm talking about is the Analog features (comparator and/or adcs) that might be already enable at POR.

    You want to send a digital signal, but it's not going to work pretty well if the I/O is set to analog at POR.

    http://ww1.microchip.com/downloads/e...Doc/39626d.pdf

    PDF page 226, ADCON1
    ADCON1=$0F ' disable all ADCs

    PDF page 235&236, CMCON
    CMCON = %00000111 ' disable comparator.. yeah even if already disable at POR

    PDF page 241 CVRCON
    CVRCON = 0

    HTH
    Steve

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

  2. #2
    Join Date
    Dec 2005
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    Steve,

    I see what you mean. I turned off all analog inputs and tried again with no luck. I also tried switching to ports c.2 and c.5 with same result. As soon as the program hits any XOUT command, the PIC apperently resets or jumps back to BEGIN. I have an output message to my LCD before and after the XOUT command. I see the LCD message before the XOUT but never see the LCD message after the XOUT. If I remove the XOUT command, the program proceeds normally.

    John P

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


    Did you find this post helpful? Yes | No

    Default

    post your whole code, configuration fuses and schematic (if possible).

    You can try to disable the watchdog timer to see if it solve some part of the problem.
    Steve

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

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Hi JohnP,

    I might be wrong , but you need activity on zero crossing pin for the XOUT command to work.
    Check out PBP manual page 163 (chapter 5.89 ).
    Hope this will help.

    Regards,

    Nick

  5. #5
    Join Date
    Dec 2005
    Posts
    14


    Did you find this post helpful? Yes | No

    Red face

    Nick,

    BINGO!!!!

    I knew it had to be something stupid!! The program waited for the command to finish and the watchdog timer reset the PIC! Disabling the watchdog timer made everything just stop when the XOUT command was executed.

    Of course, the real problem was that I didn't read the instructions in detail - I just skimmed and skimmed right past the part about "XOUT will effectively wait forever".

    Thanks again for all that replied to my problem. It wasn't a problem, but an opportunity to learn -- from those that knew better.

    John P

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