Thanks for this Brian,  I didn’t even think there was a Teensy version already. 
 I’ve reverted my base code to this version and seems to catch packets better.  
Question though, is there a specific reason why it runs @ 2mhz on the Teensy?

Bill Nobel
b_no...@hotmail.com<mailto:b_no...@hotmail.com>



On Sep 20, 2019, at 9:06 AM, Brian White 
<bw.al...@gmail.com<mailto:bw.al...@gmail.com>> wrote:

I don't remember any checksum problems with directories with this code on 
teensy 3.6

https://github.com/aljex/SD2TPDD/tree/bkw_teensy36

It's not a complete implementation though so I would be interested in a good 
solid re-do.

Note specifically the bkw-teensy36 branch, not master. Master is Jimmy Petit's 
original that I forked from.

But I was reading and writing files and using sub dirs and getting good 
listings in ts-dos etc.

On Fri, Sep 20, 2019, 5:36 AM Bill Nobel 
<b_no...@hotmail.com<mailto:b_no...@hotmail.com>> wrote:
I should also note an observation I’ve had with my code.  I’m going from the 
Teensy to a Max3232 to the T-102.  Even with power off on the 102 I receive 
garbage on the port.  My code seems to catch all the preambles though to start 
a packet. Code is starting to get larger so I’m going to post a Github for 
anybody to look at.

Bill

Sent from my iPhone

> On Sep 19, 2019, at 10:17 PM, Bill Nobel 
> <b_no...@hotmail.com<mailto:b_no...@hotmail.com>> wrote:
>
> Hi John, yes I receive 2 packets fine (with response) then things go strange 
> only on checksum.  Your C# routine is different from DLPlus for the Calc, 
> I’ll try that in the morning and see if that changes.
>
> Sent from my iPhone
>
>> On Sep 19, 2019, at 9:58 PM, John R. Hogerhuis 
>> <jho...@pobox.com<mailto:jho...@pobox.com>> wrote:
>>
>> Are you sure you got a full, aligned packet? It starts with ZZ , counted 
>> length, no missing characters?
>>
>> The DLPlus checksum is correct. More likely you're misaligned, or somehow 
>> dropped, swapped, or corrupted a character.
>>
>> Here is the C# code too for comparison
>>
>>        public byte Checksum(byte[] ary, uint ofs, uint fence)
>>        {
>>            uint sum = 0;
>>
>>            for (var i = ofs; i < fence; i++)
>>                sum += ary[i];
>>
>>            return (byte)((~sum) & 0xff);
>>        }
>>
>> Welcome to the cabal of TPDD protocol initiates.
>>
>> -- John.

Reply via email to