Serin / Serin2 / Debugin Differences


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    44

    Default Serin / Serin2 / Debugin Differences - and reading Serial data problem

    I've read on these forums, peoples opinions to use Serin, Serin2, or debugin for different applications.

    Can someone give me a quick rundown on the differences between the three - which one has what advantage, purpose better suited to etc?

    Also, one project im working on uses a pic to listen to data being sent via a serial port, and upon a certain character sequence of 6 characters, will either switch a relay on or off.
    Upon testing with hyperterminal sending a text file to the serial port, if the text file only contains the character sequence and nothing else, it switches fine, but once the sequence characters are embedded within random text, the pic does not catch the sequence and switch the relay.
    Data is @ 9600 bps, PIC16F628A @ 4 and at 20 mhz, the problem is there. Should I be using serin2 or should i be checking the data differently
    Code:
    loop:   
    
    
    		DEBUGIN 10000,loop,[WAIT("-RLY_O"), TriggerChar]	' TriggerChar = input character: o'N' or o'F'f in 10 sec
    			
    		If TriggerChar = "N" then PwrON
    		If TriggerChar = "F" then PwrOFF
    Thanks
    Last edited by jamie_s; - 19th January 2006 at 06:09.

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


    Did you find this post helpful? Yes | No

    Default

    If the PIC (as your F628) have an internal USART, i'll use it and keep code smaller. Of course you'll need additionnal hardware like MAX232 between the PIC and the PC. BUT using DEBUG, SEROUT,SEROUT you will not need it if you set to INVERTED mode.

    SEROUT2 have almost the same function as DEBUG. The main difference is that DEBUG don't allow multiple i/o, work on a fixed baudrate BUT produce a tighter code and faster baudrate when using slow speed crystal like 4 MHZ.

    SEROUT is... really limited but allow multiple serial pins, different baudrate.
    Steve

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

Similar Threads

  1. Serin to Serin2 ??
    By Gixxer in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th January 2008, 03:56
  2. Serin vs Serin2
    By The Master in forum mel PIC BASIC
    Replies: 12
    Last Post: - 19th October 2007, 16:50
  3. serin and serin2??? need to understand
    By tkly36 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th April 2006, 05:13
  4. SERIN SERIN2 Timeout
    By markedwards in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd June 2005, 18:59
  5. serin and serin2
    By rastan in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd January 2005, 13:10

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