Re: Serin general question
Do you have Include "modedefs.bas" somewhere near the beginning of your code?
Also check out the SERIN2 command.
Re: Serin general question
Why in the world would you use SERIN/SEROUT when you have hardware serial ports available?
Re: Serin general question
Yes the "modedefs.bas" has been included. Sorry I don't get the comment about hardware ports?
The LCD stuff is in there jsut so that I can see what is going on. If the Serin is removed (commented out) the program runs fine???
Re: Serin general question
The chip you are using has a EUSART = Hardware serial port.
You can use HSERIN and HSEROUT for your communications. You can read PIR1.5 (at least that is what it is in 18F chips), you have serial port interrupts, you can transfer a byte and move on.....
Things work so much better when you use the hardware that Microchip has provided.
Re: Serin general question
Understood thanks ref the HSERIN....I will give it a try. The strange thing is it works fine on the surface control unit. The other thing is I am using RS485 chips directly.
Will give it a try and report back....when normal work dosen't get in the way:)
Re: Serin general question
I could not get the HSERIN to work....probably timing and RCV stack overflowing. I can't see how I can use the interupt because I don't want to interupt the program.....the motor/thruster commands must take priority. However I did fianlly manage to get the SERIN/SEROUT working, it was a stupid mistake in my program - the jump to statement was pointing to the wrong place. Would like to use the HSERIN though at some point I think it would give better control and think it would also allow me to reduce one of the additinal PCB's.
Thanks for your help
Re: Serin general question