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 <[email protected]> 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 <[email protected]> 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 <[email protected]> > 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. >
