Josh Koffman gmail.com> writes: Hello Josh, > > Alright, I've been reading the datasheet and now I have more questions > (go figure)! > > I've been looking at DS39631A - the PIC18F2520 datasheet. > > On page 166 (section 17.3.5 Master Mode) it's talking about the SPI > clock rate and how we can select it. The following options are given: > > Fosc/4 (or Tcy) > Fosc/16 (or 4 . Tcy) > Fosc/64 (or 16 . Tcy) > Timer2 Output/2 > > So my question is...should the dot that preceeds the Tcy be something > else? If it really does mean multiplied by, I just don't understand > it...Fosc/16 should be 1/4 the instruction speed correct? It takes 4 clock cycles for one instruction, therefore Tcy = 1/(Fosc/4). One way to think about it is that "frequency" of instructions is Fosc/4. For MSSP clock speed Fosc/16 you will have Fmssp = Fosc/16, while period of the clock Tmssp = 4*Tcy. > > Second, am I correct in determining that if I want to clock data out > of my wireless module, I should keep my PIC in master mode so that it > generates the clock signal? If so, from my understanding I need to > write a byte to the SSPBUF register. At that point my data will be > clocked out as the incominging data is clocked back into SSPBUF. > I did not use MSSP in SPI mode, but in I2C the module will first clock out address and indicate read/write mode (last bit of the address). Slave will provide data if master requests a read. The master provides the clock. Sergey Dryga Beaglerobotics.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist