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




Bookmarks