View Single Post
  #5   Spotlight this post!  
Unread 11-01-2007, 15:06
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: SPI Port on Robot Controller

If you visit the IFI site and look for the pdf file:

http://www.ifirobotics.com/docs/anal...al--i-o-rc.pdf

It shows resistors and capacitors conditioning all the io pins of the robot controller. These are between the PIC18F chip and the external pins we can attach to. They're essentially a low pass filter, high frequency noise gets gobbled up by the capacitor. In almost all cases, programmers won't care that they are there... actually they will be happy because these automatically filter off glitches and debounce stuff and the like for you.

http://en.wikipedia.org/wiki/RC_circuit

When programming, if an external sensor sets a 1 or 0 on the input line of the controller, the PIC chip won't see that 1 or 0 for a while. How long it takes for the 0 to be seen as a 1 depends on the RC constant which introduces a delay expressed at tau (t). The wiki page shows the rise/fall times and how many (t) time periods it takes to reach a specific voltage percentage. Tau is R*C.

In practice all this means if you turned an output on and off and on and off etc. very quickly - nothing would happen externally, the on/off transitions are spaced too closely together.

Similarly, if there is an external sensor that is generating very small width pulses it is possible they could be missed because they were filtered off. We're talking 10us or so for inputs, less for outputs.

The whole purpose of the RC network filter in the first place is to take care of the ambient noise picked up on all the attached sensor cables. For the most part, programmers don't care... until. Until we try to use the digital io as a serial data line for communication. In that case we want to know how fast can we pump data bits out one of the digital lines without being filtered off.

The resulting "pulses" since they have long rise and decay times don't look like pulses at all when they are small - much more rounded. This can cause problems when interfacing to raw external digital logic parts which often have requirements of max rise/fall times. To clean them up you can use schmitt triggers which, ... well read the wiki:

http://en.wikipedia.org/wiki/Schmitt_trigger

Bud