View Single Post
  #8   Spotlight this post!  
Unread 27-03-2008, 00:13
FIRSTMa2104's Avatar
FIRSTMa2104 FIRSTMa2104 is offline
Registered User
FRC #2104 (Colonel Robotics)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Worcester, Ma
Posts: 20
FIRSTMa2104 is on a distinguished road
Re: Parity on the RC controller

Quote:
Originally Posted by Alan Anderson View Post
Ken Streeter already answered you: there is no hardware support for parity on the serial communication ports on the PIC18F8722 used in the Robot Controller.

You said you wrote a "serial API". Can't you change it so that it doesn't require an extra parity bit?
I did try setting parity to none but then that caused the IR not to communicate with anything at all, even with the hyper terminal on the PC. So I figured it will work only with parity set to even.

Quote:
Originally Posted by Ken Streeter View Post
Thanks for the clarification that you are indeed using the TTL Serial Port. Just to add a bit more information to my prior post...

As I mentioned earlier, this serial port does not natively support parity calculations. I'd suggest you take a look at the PIC18F8722 Data Sheet (from the Microchip web site.) Section 20.2 says that "Parity is not supported by the hardware, but can be implemented in software and stored as the 9th data bit."

If you would like to add parity calculations to Kevin's serial port code, it could probably be done without too much hassle, but would need to be implemented in software. Pages 250 and 251 of the PIC18F8722 data sheet describe the register bit settings that would need to be changed to have the serial port expect the 9th data bit (for parity).

Best regards,
--ken
Thank you, I didn't know that data sheet ever existed (mainly cause I didn't search for it),I think what you told me and what the data sheet explains will help me code.
__________________