squelch doesn't seem the way to go


Results 1 to 14 of 14

Threaded View

  1. #8
    Join Date
    Aug 2008
    Posts
    20


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by eng.alamin View Post
    you know if you use hardware UART your code will be much better in this case
    i already advised you to use pic's hardware UART in my first replay

    anyway any thing hard for first time don't be frustrated

    i don't know which pic that you use , so i assumed that you use pic16f877a

    here is small code will guide to use HARDWARE UART with pic basic pro

    Code:
    'small code for my friend 
    'eng.alamin
    '------------------------
    
    buffer var byte [10]  ' your stream buffers  
     x  var byte  ' for counter
    SPBRG = 12 ' 4800 clock must be 4MHz (sorry my friend but it's not inverted )
    
    RCSTA = %10010000  ' Enable RX
    TXSTA = %00100000  '    //    TX
    
    main
    
    low porta.0   '  disable your sqaulch circuit ;)
    gosub  lunix 
    gosub  pc
    
    lunix:
    if pir1.5 = 1 then     ' this is the wicked :)
    
    high porta.0    'Enable sqaulch circuit
    
    buffer[0]  = RCREG
    
    endif
    return
    
    
    pc :
    
    if PIR1.4 = 0 then pc   ' wait for loading 
    
    TXREG = buffer[0]     ' send data to your pc
    
    low porta.0   '  disable your sqaulch circuit ;)
    return

    this program will allow you to receive only one byte and transmit it
    edit and modify it according to your circuit to you have to work in loading all in coming data in buffer[x] by increasing x and adding some code line
    also you can invert logic by using NPN transistor
    ididn't compile this program i just worte it here so you may find dumb mistakes

    ---------

    regards
    Last edited by eng.alamin; - 2nd November 2008 at 11:24.

Similar Threads

  1. RF Transmitter/Reciver
    By Fredrick in forum General
    Replies: 75
    Last Post: - 4th May 2008, 02:19
  2. SERIN Timeout
    By George in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 23rd March 2007, 16:06

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