Pic to Pic communication


Results 1 to 12 of 12

Threaded View

  1. #6
    Join Date
    Jun 2009
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Using the below code and two PIC 16F684s I don't get the results I am looking for.

    The DEBUGIN doesn't appear to be working. What have I missed?
    Code:
    '----MASTER CODE-------
    DEFINE DEBUG_REG PORTC
    DEFINE DEBUG_BIT 2
    DEFINE DEBUG_BAUD 2400
    DEFINE DEBUG_MODE 0
    bvar    var     byte
    
    Pause 2000
    bvar = 1
    
    Loop:
    	DEBUG bvar
    Goto Loop:
    
    
    '----SLAVE CODE-------
    
    DEFINE LOADER_USED 1 
    DEFINE DEBUGIN_REG PORTC
    DEFINE DEBUGIN_BIT 2
    DEFINE DEBUG_BAUD 2400
    DEFINE DEBUGIN_MODE 0
    
    bvar   var     byte
    
    TRISA = %001000
    PORTA = %000001
    
    Pause 2000
    
    Loop:
    	DEBUGIN 4000, timesup, [bvar]
    	IF (bvar = 1) then
    		PORTA = %000010
    		Pause 4000
    	ENDIF
    Pause 2000
    		PORTA = %000100
    Pause 2000
    		PORTA = %100000
    Pause 2000
    
    Goto Loop:
    
    timesup:
    	PORTA = %010000
    Pause 2000
    	PORTA = %000001
    Return
    Last edited by fignewt; - 24th June 2009 at 02:56.

Similar Threads

  1. 2 PIC, serial communication
    By lightgreen in forum Serial
    Replies: 6
    Last Post: - 21st November 2009, 15:20
  2. PIC to PIC "wired" serial one-way communication - SERIN2/SEROUT2
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th April 2008, 20:02
  3. PIC 2 PIC communication
    By Mario in forum Forum Requests
    Replies: 16
    Last Post: - 28th April 2006, 01:56
  4. Serial communication PIC to PIC help.
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2005, 15:45
  5. Pic to Pic communication?
    By Rob Martin in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th April 2004, 19:41

Members who have read this thread : 1

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