HSEROUT of array of data with termination on a null


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Location
    South Wales (UK)
    Posts
    62


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT of array of data with termination on a null

    Ok, didn't go for the full 65,536 pages.

    Set initially to transfer 16 pages which brought it down to something considerably less.

    Then upped it to transfer 64 pages which only improved it by about 20 minutes.

    ** Final result: a few minutes over 5 hrs

    This is probably slightly higher than your original estimate (@Tumbleweed) due to having to transfer each page (very brief but does add up I guess).

    Thank you!!!

  2. #2
    Join Date
    Aug 2011
    Posts
    460


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT of array of data with termination on a null

    Final result: a few minutes over 5 hrs
    That's probably not too bad, considering you have to send packet requests to get data.

    Doing that's a good idea... I was worried you were just going to stream 256MB out the pic and expect the PC to keep up.

  3. #3
    Join Date
    Sep 2009
    Location
    South Wales (UK)
    Posts
    62


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT of array of data with termination on a null

    Hi Tumbleweed,

    Looking at the DS (Pg 342 / Ex 21-1), the calc, using the crystal on this board:

    (((22,118,400 / 230,400) / 64) - 1) = 0.5

    When sent to the SPBRG, this will result in just 0

    Reversing:

    22,118,400 / (64 (0 + 1)) = 345,600 BAUD

    Is that correct?

    I've checked the output file on the PC side and it's all correct - I just substituted '65' instead of the data from the on-board memory, and the file is filled with 'A''s...

    The fact that there is no errors - is this because it's asynchronous and the systems are just managing, or am I missing something here?

    Edit - just found a site that says switching on the BRGH = 1 with SPBRG = 5, BRG16 = 1, I can achieve 921,600 BAUD. I vaguely remember doing this about 6 years ago with a really bespoke strip board setup! Well, just tested it and the data continues to stream through to file seamlessly.

    2.46 hrs for 256 MB.

    Will have another read of the DS as I'm definitely missing something here.

    Edit!

    Ok, just realised my ref for Ex 21-1 on Pg 342 of the DS was for 8-bit BRG!

    The correct formula (for anyone that's following this path), with BRGH = 1 with SPBRG = 5, BRG16 = 1, and using a 22.1184 MHz Xtal, should be:

    Fosc/(4 * (n + 1)) where n is the SPBRG value (5), so 22,118,400 / (4 * (5 + 1)) = 921,600 BAUD.

    Perfect.

    Best,

    Jimbo
    Last edited by jimbostlawrence; - 12th October 2020 at 20:11.

  4. #4
    Join Date
    Aug 2011
    Posts
    460


    Did you find this post helpful? Yes | No

    Default Re: HSEROUT of array of data with termination on a null

    Jimbo,

    The pic can transmit at that rate but you might run into trouble receiving.
    921K is only 10us/byte, so you'll have to be able to handle incoming data at that rate.

    I've run 460K baud with FOSC=64MHz, but it gets pretty tight much faster than that.
    YMMV

Similar Threads

  1. Null statement (NOP or CONTINUE)
    By RussMartin in forum General
    Replies: 8
    Last Post: - 4th February 2009, 22:28
  2. How to get ASCII data in array.
    By Ioannis in forum Serial
    Replies: 8
    Last Post: - 6th November 2008, 21:14
  3. Bit/Byte array for Hserin/Hserout
    By mrx23 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd September 2006, 00:07
  4. 8 data and parity using HSERIN, HSEROUT
    By Smity42 in forum Serial
    Replies: 2
    Last Post: - 3rd April 2006, 02:45
  5. Array data being corrupted
    By caverman in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th March 2006, 05:22

Members who have read this thread : 2

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts