mikroElektronika PIC Microcontrollers PIC12 User Manual page 277

Mikroc user's manual
Table of Contents

Advertisement

mikroC
making it simple...
Library Example
The code demonstrates how to use SPI library functions. Assumed HW configura-
tion is: max7219 (chip select pin) connected to RC1, and SDO, SDI, SCK pins are
connected to corresponding pins of max7219.
//------------------- Function Declarations
void max7219_init1();
//-------------------------------- F.D. end
char i;
void main() {
Spi_Init();
TRISC &= 0xFD;
max7219_init1();
for (i = 1; i <= 8u; i++) {
PORTC &= 0xFD;
Spi_Write(i);
Spi_Write(8 - i);
PORTC |= 2;
}
TRISB = 0;
PORTB = i;
}//~!
MikroElektronika: Development tools - Books - Compilers
mikroC - C Compiler for Microchip PIC microcontrollers
// Standard configuration
// Initialize
max7219
// Select max7219
// Send i to max7219 (digit place)
// Send i to max7219 (digit)
// Deselect max7219
page
269

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Pic microcontrollers pic16Pic microcontrollers pic18

Table of Contents