Have a look to that thread :
http://www.picbasic.co.uk/forum/showthread.php?t=1217

here you have the solution to put your 24 bits into something usable ... just divide them as soon to reduce it to less than 16 bits ...

and that's all !!!

Alain