HighSpeed A/D and Baud Rates


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Im sending HSEROUT [ bin ADRESH,Bin ADRESL," "] Is this 3 bytes of data total or 6 bytes?
    No.
    It's actually 17 bytes. The "BIN" qualifier sends one byte for each bit, either "0" or "1". If you want 3 bytes, you need to delete the two "BIN":

    HSEROUT [ ADRESH, ADRESL," "]

    BTW, If you want fast a/d, then you need to start the new a/d conversion as soon as the last one was finished--don't wait until after your serial is sent.
    Last edited by tenaja; - 14th January 2010 at 00:51. Reason: add sample

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    The way to really get some speed is to send two bytes only. The TXregister is copied to the transmit shift register one clock cycle after you load the TX register, then the TX register can be loaded immedately again. Your routine can proceed while the bytes are being sent.

    If you send more than two bytes, your routine has to wait until all but the last two bytes are shifted out.

    Sending two bytes takes only microseconds (in program time), while sending more than two bytes takes those same microseconds + ((number of bytes - 2)* byte send time).

    Another way to make things go fast - as Tenaja has said, don't use the ADCIN command. Instead, do it manually.

    1. Set up the ADC channel and start the conversion.
    2. Send some data.
    3. Read the result of the conversion you started in step 1.
    4. Set up the ADC channel and start the conversion.
    5. Send some data.
    7. Read the result of the conversion your started in step 4.
    8. Go back to step 1.
    Charles Linquist

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 21:58
  2. DEBUG baud rates
    By btaylor in forum Serial
    Replies: 6
    Last Post: - 23rd January 2006, 13:00
  3. Auto Baud Rate Detection
    By mytekcontrols in forum Serial
    Replies: 10
    Last Post: - 31st October 2005, 03:17
  4. Faster baud rates with SEROUT commands
    By TurboLS in forum PBP Wish List
    Replies: 1
    Last Post: - 19th February 2005, 11:05
  5. Baud Rate and Timing Calculator
    By picnaut in forum General
    Replies: 3
    Last Post: - 23rd January 2004, 17:48

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