Quote Originally Posted by gengkeys View Post
i've tried that ways but still have a problem...i still can't communicate CMUcam with the PIC...

define osc 20

include "modedefs.bas"
main:
serout portc.6,84,["L1 1",CR]
serin portc.7,84,[(":")]

debug "LED on ACK:received OK",CR

pause 500

serout portc.6,<font color=red>84,</font color>,["L1 2",CR]
serin portc.7,84,[(":")]

debug "LED off ACK:received OK",CR

pause 500
goto main

this coding has no error but it's not working...can you comment why it happen???...
84 is a serout2 and serin2 command for 9600 baud not serin serout ( at least I do not see where it is supported) the CMUCam2 manual says to set communications to 115,200 , 8, 1, N. And to add \n to a received \r. See page 12, the old version says the same. So you might think good thoughts about using HSERIN. Here are the numbers fresh off mister_e's calculator:
Code:
RCSTA = $90 ' Enable serial port & continuous receive
TXSTA = $24 ' Enable transmit, BRGH = 1
SPBRG = 10  ' 115200 Baud @ -1.36%
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 10  ' 115200 Baud @ -1.36%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically