USB Serial Communication Continuous


Results 1 to 17 of 17

Threaded View

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

    Default

    I've never tried with a DEFINE OSC 20... but i think it's the main problem.

    Look how i did it in mine. (config fuse as well)

    and now
    Code:
    DoLow:
    LOW PORTC.0
    USBSERVICE
    PAUSE 30
    USBSERVICE
    return

    This example don't use instant interrupt, inserting a PAUSE and using On INTERRUPT GOTO might cause some problem for the USBSERVICE.

    next point...i don't know what's happen if you use both HSER_BAUD and HSER_SPBRG together... Assuming HSER_SPBRG may override the HSER_BAUD, you have a big problem as your SPBRG value is way out of range @20MHZ... but good @8MHZ.

    to have 2400 baud @20MHZ, you should use...
    Code:
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
    DEFINE HSER_SPBRG 129 ' 2400 Baud @ 20MHz, 0.17%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    I do believe the HSER_CLROERR may help a little bit.

    There's probably something else... i feel a bit lazy today
    Last edited by mister_e; - 10th February 2007 at 18:03.
    Steve

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

Similar Threads

  1. Dynamic USB Serial Number (PIC18F4550)
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th July 2009, 17:03
  2. Serial data to USB
    By cooksydesign in forum USB
    Replies: 18
    Last Post: - 29th October 2008, 15:10
  3. USB and serial cable connection(s)
    By ardhuru in forum Schematics
    Replies: 3
    Last Post: - 18th August 2008, 15:26
  4. Bafo USB to serial adapter
    By ardhuru in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th July 2006, 18:48
  5. Serial to USB converter
    By jrt4fun in forum USB
    Replies: 6
    Last Post: - 8th August 2005, 15:14

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