i'm writing a small output generator to make hex data files to program eproms. i will be giving a web based interface to plug in the values desired to write to the chip ( in english standard 96 char set ) then push this to a formatted output in intel hex layout, i'm doing great on all aspects of it other than evaluating the checksum, i've never dealt with hex based checksums and it's messing my head up after stacking all these function calls to get all the formatting.
currently the place i think it would fall into place is the actual encoding of the string value to hex :
i dont really have anything handy to validate if the checksum is correct but here's sample output :
GARAGE
47.41.52.41.47.45 1A7
the periods are just there for visual breaks
so in essence my question is, am i doing this correctly/getting the correct checksum... if n ot, how would i go about correcting it ?
DreX
aKa - Robert
currently the place i think it would fall into place is the actual encoding of the string value to hex :
Code:
function Txt2Hex(StringVal)
Txt2Hex = ""
CheckSumVal = 0
For ChrPos = 1 to Len(StringVal)
CurrentLetter=Mid(StringVal,ChrPos,1)
Txt2Hex = Txt2Hex & Hex(Asc(CurrentLetter))' & " "
CheckSumVal = CheckSumVal + Asc(CurrentLetter)
Next
Txt2Hex = Txt2Hex & " " & Hex(CheckSumVal)
End function
i dont really have anything handy to validate if the checksum is correct but here's sample output :
GARAGE
47.41.52.41.47.45 1A7
the periods are just there for visual breaks
so in essence my question is, am i doing this correctly/getting the correct checksum... if n ot, how would i go about correcting it ?
![[thumbsup2] [thumbsup2] [thumbsup2]](/data/assets/smilies/thumbsup2.gif)
aKa - Robert