;************************************ INIT_SPI.inc=20 ******************************** ; This routine initializes the 18C452 Sync Serial Peripheral Interface=20 for communications. ; The SPI is in Master mode.=20 ; ; Author: Thomas C. Sefranek 2-6-2002 ; ;************************************************************************= ********** ; Init_SPI MOVLW B'01000000' ; Form the Control byte to: ; <7> Input data sampled in the middle of data. ; <6> =3D 1 Data sent on rising edge of clock. EEPROM ; <5:1> IIC mode only (Unused). ; <0> Reset Buffer full flag. MOVWF SSPSTAT ; <7> Input sampled at middle of output time. ; <6> Data transmitted on rising edge of clock. ; <5:1> Unused ; <0> Reset Buffer full flag. MOVLW B'00100011' ; Form the Control byte to: ; <7> Reset Write Collision flag. ; <6> Reset receive Overflow flag. ; <5> Enable the Sync Serial Port. ; <4> Set clock line Low during idle. ; <3:0> Timer 2 out / 2. (4 Megabaud.) MOVWF SSPCON1 ; Initialize the SSP Control Register1. CLRF SSPCON2 ; Initialize the SSP Control Register2. > >-----Original Message----- >From: K=FCbek Tony >To: PICLIST@MITVMA.MIT.EDU >Date: jueves 7 de febrero de 2002 13:30 >Subject: Re: [PIC]: 18c452 - Master mode SPI sends no data > >>Hi, >>here are some code that works on an 16F87x, should be minor >>differences with the 18xx. >> --=20 * | __O Thomas C. Sefranek tcs@cmcorp.com |_-\<,_ Amateur Radio Operator: WA1RHP (*)/ (*) Bicycle mobile on 145.41, 448.625 MHz ARRL Instructor, Technical Specialist, VE Contact. http://hamradio.cmcorp.com/inventory/Inventory.html http://www.harvardrepeater.org -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics