Serial Baudrate 115200


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    Selangor, Malaysia
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    I know the hserout instruction is for the hardware USART, but how about the SerIn2 and Serout2 command.

    Do you guys use Serin2 and Serout2 command instead of hserout?

    What is the main difference between Serin2/Serout2 and hserout?

    How to set the 115200 baud rate for serin2/serout2 bcoz previously i was using these command to connect to a gsm module with 19200 baud rate?

    Thanks

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Hi kblim,

    As far as I know, you can't use baud rates higher than 38400 baud (I think) with the ser-type commands.
    I'm sure you can't do 115200.
    This is because the ser-type commands use a "bit-banging" approach as opposed to the hser-type commands which use the built-in usart and generate less code.

    This was the first time that I heard that you can communicate at 115200 using debug though.
    What are the pros and cons of that anyhow, Bruce?

    Regards.
    ---> picnaut

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    The serin, serout type commands were originally designed to offer BASIC Stamp users similar commands. They all produce huge code when used because the command libraries have to cover so many various options to maintain Stamp compatibility.

    Debug/Debugin produce much smaller code, and offer the higher data-rates because the library routines are much smaller.

    Serin, serout commands can be used on any I/O-pins that support digital I/O. Data-rates & pins used can be changed on the fly. Debug/Debugin pins & data-rates are fixed with the DEFINE used to set them up, but offer much higher data-rates since the library routines are much smaller.

    If you need higher baud rates with slower osc speeds, then use Debug and Debugin if you can live with fixed rates & pins you can use.

    Of course you can use them all if needed, but I'll normally opt for the hardware USART or Debug/Debugin.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4
    Join Date
    Jul 2005
    Location
    Selangor, Malaysia
    Posts
    31


    Did you find this post helpful? Yes | No

    Default Using Open Mode with Debug/DebugIn

    Hi all,
    Just wonder how to define the debug to communicate with the open mode when receiving serial data from other device. Using the open mode because need to share the data line with few PICs.
    It is possible to do Open mode for DebugIn, Non Open Mode for Debug?

    Kindly share your expectise.

    Thanks alot.

    Regards

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    There is one other possible unconventional solution... Set SERIN2/SEROUT2 to run at 11500 baud at 4MHz and then switch to 40MHz Oscillator (approipriate 18F PIC Series) WITHOUT telling PICBasic you've done so... everything works at x10 speed... so PAUSE 1000 will only give you 100mS instead of a Second. In theory it should work (I'd use 67 rather than 66 as the calculated Speed figure)...

  6. #6
    Join Date
    Jul 2005
    Location
    Selangor, Malaysia
    Posts
    31


    Did you find this post helpful? Yes | No

    Unhappy How to setup Debug in Open Mode Like SerialOut

    Hi all,
    I was previously using the SerOut2 to send data, but the data line was sharing by few PICs and I have used Open Mode.
    Recently porting my code by replacing SerOut2 with the Debug command to save same space. But later found out that there are no way to setup the Debug in the open mode.
    Please help! Is there neccessary to use Open mode to share the data? or the Debug doesn't need the Open mode even sharing the data line.

    Regards

  7. #7
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    I have an application where a PIC12F683 has to communicate with an external peripheral. I need SerIn/SerOut because the external device may be 4800 or 9600 bps.

    The PIC12F683 also needs to communicate with a PIC16F876A.

    Is there any advantage to using Debug/DebugIn for the PIC2PIC comms given that the PIC12F683 already uses SerIn/SerOut?

Similar Threads

  1. Replies: 33
    Last Post: - 19th March 2010, 03:02
  2. Dynamic USB Serial Number (PIC18F4550)
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th July 2009, 17:03
  3. 16f88 internal osc 8mhz max serial baudrate ?
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th December 2008, 23:27
  4. PIC18F4680 to PC via MAX232 (RS232 serial) no output
    By opticsteam1 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th April 2008, 20:39
  5. interfacing to the pc serial port
    By kelangfei in forum General
    Replies: 4
    Last Post: - 7th October 2007, 22:35

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