| Electronic Components Datasheet Search |
|
PIC24F04KA201 Datasheet(PDF) 121 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC24F04KA201 Datasheet(HTML) 121 Page - Microchip Technology |
|
121 / 224 page ![]() © 2009 Microchip Technology Inc. Preliminary DS39937B-page 119 PIC24F04KA201 FAMILY To set up the SPI module for the Enhanced Buffer Master (EBM) mode of operation: 1. If using interrupts: a) Clear the respective SPI1IF bit in the IFS0 register. b) Set the respective SPI1IE bit in the IEC0 register. c) Write the respective SPI1IPx bits in the IPC2 register. 2. Write the desired settings to the SPI1CON1 and SPI1CON2 registers with the MSTEN bit (SPI1CON1<5>) = 1. 3. Clear the SPIROV bit (SPI1STAT<6>). 4. Select Enhanced Buffer mode by setting the SPIBEN bit (SPI1CON2<0>). 5. Enable SPI operation by setting the SPIEN bit (SPI1STAT<15>). 6. Write the data to be transmitted to the SPI1BUF register. Transmission (and reception) will start as soon as data is written to the SPI1BUF register. To set up the SPI module for the Enhanced Buffer Slave mode of operation: 1. Clear the SPI1BUF register. 2. If using interrupts: a) Clear the respective SPI1IF bit in the IFS0 register. b) Set the respective SPI1IE bit in the IEC0 register. c) Write the respective SPI1IPx bits in the IPC2 register to set the interrupt priority. 3. Write the desired settings to the SPI1CON1 and SPI1CON2 registers with the MSTEN bit (SPI1CON1<5>) = 0. 4. Clear the SMP bit. 5. If the CKE bit is set, then the SSEN bit must be set, thus enabling the SS1 pin. 6. Clear the SPIROV bit (SPI1STAT<6>). 7. Select Enhanced Buffer mode by setting the SPIBEN bit (SPI1CON2<0>). 8. Enable SPI operation by setting the SPIEN bit (SPI1STAT<15>). FIGURE 15-2: SPI1 MODULE BLOCK DIAGRAM (ENHANCED BUFFER MODE) Internal Data Bus SDI1 SDO1 SS1/FSYNC1 SCK1 SPI1SR bit 0 Shift Control Edge Select FCY Enable Sync SPI1BUF Control Transfer Transfer Write SPI1BUF Read SPI1BUF 16 SPI1CON1<1:0> SPI1CON1<4:2> Master Clock 8-Level FIFO Transmit Buffer 8-Level FIFO Receive Buffer Clock Control Primary 1:1/4/16/64 Prescaler Secondary Prescaler 1:1 to 1:8 |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |