strange serout2 problem


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009
    Posts
    7

    Question strange serout2 problem

    Hi everyone, and happy new year

    I am trying a rs232 communication. I use 16f84a. I am a beginner in electronics.
    This problem seems strange:

    I use hyper terminal. I have a Max232 circuit with Sub-D 9-F. I also send the schematic of the circuit (my source is http://sodoityourself.com/max232-ser...vel-converter/ )

    Here is the problem, controller led is blinking but there is nothing on hyper terminal

    Code:
        
        OutGoing VAR Byte
        OutGoing = "K"    
        
    
        D_Forwarder VAR PORTB.3  'data forwarder
        
        Forwarder VAR PORTA.1  ' Controller led      
     
     PAUSE 500
     
    main:
            SEROUT2 D_Forwarder,396,["O",OutGoing ] '2400 baud rate
            HIGH Forwarder    
            PAUSE 100
            LOW Forwarder
    
    goto main
    But in this code, while the led is blinking i also see both of the O and K characters, it works.

    Code:
        
        OutGoing1 VAR Byte
        OutGoing1 = "K"  
     
        OutGoing2 VAR Byte
        OutGoing2 = "S"    
        
        D_Receiver PORTB.2       'data receiver
        D_Forwarder VAR PORTB.3  'data forwarder
        
        Forwarder VAR PORTA.1  ' Controller led     
        Receiver VAR  PORTA.0   ' Controller led  
     
     PAUSE 500
     
    main:
            SEROUT2 D_Forwarder,396,["O",OutGoing1 ] '2400 baud rate
            HIGH Forwarder    
            PAUSE 100
            LOW Forwarder
    
            SEROUT2 D_Receiver ,396,["O",OutGoing2 ] 
            HIGH Receiver 
            PAUSE 100
            LOW Receiver 
    
    goto main
    Is this correct?
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    This line in the program you say works should cause the program to not compile.
    Code:
    D_Receiver PORTB.2       'data receiver
    You forgot the VAR.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Dec 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    I erased it accidently, sorry There is a VAR over there, it compiles.

Similar Threads

  1. Serout and 18F87J50
    By Glenn_Webber in forum Serial
    Replies: 8
    Last Post: - 20th November 2009, 14:26
  2. PIC stop responding - Strange Problem!
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 31st August 2009, 14:06
  3. SLOW Serin2 and Serout2
    By dragons_fire in forum General
    Replies: 3
    Last Post: - 26th June 2009, 02:38
  4. strange problem 12f675
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th July 2007, 13:47
  5. Advantages of HSerout over Serout2 and a problem
    By rpstroj in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th August 2004, 22:19

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