+ Reply to Thread
Page 4 of 4
First 1 2 3 4
Results 46 to 55 of 55

Thread: Remote Control by cellphone...

  1. #46
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,775

    Default

    Are you sure the polarity of the data was correct?, remember the MAX232 inverts it - and are you sure the baud rate was set correctly?. Both of these will give weird characters.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk


  2. #47
    emufambirwi Newbie
    Join Date
    Sep 2005
    Location
    Zimbabwe
    Posts
    36

    Default

    Yes, the baud rate was set correctly as follows in software.

    TXBYTE MOVWF BYTE ;save table value to BYTE
    MOVLW 0x08
    MOVWF BITCNT ;do eight times
    BCF TXPIN ;SEND START BIT
    CALL Bit_Delay ;delay 104 instruction cycles
    ;assuming 4MHz clock, that's 1us per instruction cycle
    ;so delaying 104us
    TXLOOP RRF BYTE,F ;move BYTE bit0 into carry
    BTFSS STATUS, C ;a Low ?
    BCF TXPIN ;yes, send it
    BTFSC STATUS, C ;a High?
    BSF TXPIN ;yes, send it
    CALL Bit_Delay
    DECFSZ BITCNT
    GOTO TXLOOP ;loop for 7 more times
    BSF TXPIN ;SEND STOP BIT
    CALL Bit_Delay
    RETURN
    People perish because of lack of knowledge

  3. #48
    emufambirwi Newbie
    Join Date
    Sep 2005
    Location
    Zimbabwe
    Posts
    36

    Default

    sorry about the above post, the 104us delay is generated as follows, I have simulated the program using mplab and the timing is correct.
    Bit_Delay
    MOVLW 0x21
    MOVWF DELAYCNT

    DELAYLOOP
    DECFSZ DELAYCNT ;one cycle if DELAYCNT
    GOTO DELAYLOOP ;two cycles
    RETURN
    People perish because of lack of knowledge

  4. #49
    emufambirwi Newbie
    Join Date
    Sep 2005
    Location
    Zimbabwe
    Posts
    36

    Default

    My code snippets are not coming out clearly, what do I do?
    People perish because of lack of knowledge

  5. #50
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,775

    Default

    Quote Originally Posted by emufambirwi
    My code snippets are not coming out clearly, what do I do?
    Surround them with the 'Code' tags, click on the 'Advanced' button where it's an option.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  6. #51
    emufambirwi Newbie
    Join Date
    Sep 2005
    Location
    Zimbabwe
    Posts
    36

    Question

    I did not receive a comment on my delay, is it ok
    People perish because of lack of knowledge

  7. #52
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,775

    Default

    Quote Originally Posted by emufambirwi
    I did not receive a comment on my delay, is it ok
    I didn't check it, just use the one from my tutorial which is known to work (uses a 4MHz clock).
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  8. #53
    emufambirwi Newbie
    Join Date
    Sep 2005
    Location
    Zimbabwe
    Posts
    36

    Default

    Quote Originally Posted by Nigel Goodwin
    Are you sure the polarity of the data was correct?, remember the MAX232 inverts it
    How do I invert the data again in software?
    People perish because of lack of knowledge

  9. #54
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,775

    Default

    Quote Originally Posted by emufambirwi
    How do I invert the data again in software?
    Switch the BCF's and BSF's in the transmit routine - don't forget the start and stop bits as well.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  10. #55
    emufambirwi Newbie
    Join Date
    Sep 2005
    Location
    Zimbabwe
    Posts
    36

    Default

    ok thanks, feedback later
    People perish because of lack of knowledge

+ Reply to Thread
Page 4 of 4
First 1 2 3 4

Tags for this Thread