Tried that - this is the result:
A8
13
06
46
A4
65
76
E5
CRC Error E5
JohnB
Tried that - this is the result:
A8
13
06
46
A4
65
76
E5
CRC Error E5
JohnB
You are jumping around the subroutine upon start up right? If your software is verbatum to what you posted then you need to add Goto Start just before the CRC8: label and place a Start: label before your testcode comment. I'm not sure what PBP will do with variables declared after coding starts but I would move the TestData VAR Byte(8) up to before the subroutine where the other declarations are.
Again, I'm away from home for a couple of days so I can't test the code.....
Tom
Can't believe how stupid I have been, indeed it was an extract from a much larger program which I was having a problem with. In the extract I was skipping over loading the array so it was never getting to operate on correct data.
I will now have to go back to my original code and see where it is going wrong as I still have a problem with the real code, it just not with the CRC calc as I h ad originally thought.
Sorry to have bothered you.
JohnB
Yesterday I have implemented the CRC-8-calculating from 1-wire with a short routine without tables from:
http://www.dattalo.com/technical/software/pic/crc.php
PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2
Bookmarks