HSEROUT of array of data with termination on a null


Results 1 to 19 of 19

Threaded View

  1. #15
    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 19:11.

Similar Threads

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

Members who have read this thread : 1

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