Thanks Robert,
I am using PBP V2.6 with a PicKit 2 programmer and a low pin count USB board and 18F14K50.
I have had some success by enabling PBPL in MCS.
The values I am after and the values I get are really close. Probably close enough for this particular project.
mmH2O _______Knots ________Pic Output to serial port
15_____________ 30______________ 30.09
26.5 ___________40_______________39.56
41.5 ___________50_______________50.16
60 _____________60______________60.19
81.5 ___________70______________69.61
106.5 __________80______________80.2
134.5 __________90______________89.72
166.5 _________100______________99.75
201 ___________110_____________109.79
239.5 _________120_____________119.8
To get these values I used
Code:
knots var long
knotsRem var long
counts var long
pause 100
MAINLOOP
for counts = 0 to 10000
knots = ((SQR(counts*100))*1563)/10000
knotsRem = (SQR(counts*100)*1563)//10000
serout2 portb.7,396,[ #Knots,".",dec3 knotsRem," ",#counts,","," Knots",13,10]
'pause 10
next
Goto Mainloop
But there are a few "oddities" I dont know how to deal with.One thing I did see was a printout like this. 1st coulmn is Knots and the second
the counts corresponding to that value.the question I have is why so many values the same, and then it jumps by about .5 knots. As I said, not critical in this instance, but may be in a future project and if I can get it sorted now all the better.
143.708 8404, Knots
143.708 8405, Knots
143.708 8406, Knots
143.708 8407, Knots
143.708 8408, Knots
143.271 8409, Knots
143.271 8410, Knots
143.271 8411, Knots
143.271 8412, Knots
143.271 8413, Knots
143.271 8414, Knots
143.271 8415, Knots
I am guessing its the integer math thing again, just after some clarification
Acetronics,
Yes, its not me its Excel !!
I did recalculate it in Excel by using the "ROUND" function, but his rounds up or down. I would expect that integer math always rounds down. I am guessing correctly?
Thanks
aajgss
Bookmarks