TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (91 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139266 times)
  2. FAT32 Library (71754 times)
  3. Network Ethernet Library (57128 times)
  4. USB Device Library (47432 times)
  5. Network WiFi Library (43092 times)
  6. FT800 Library (42408 times)
  7. GSM click (29835 times)
  8. mikroSDK (28101 times)
  9. PID Library (26886 times)
  10. microSD click (26198 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Example

SPI master slave party pack

Rating:

0

Author: Joakim Tysseng

Last Updated: 2016-02-25

Package Version: 1.0.0.0

Example: 1.0.0.0

Category: Communication

Downloaded: 1355 times

Followed by: 2 users

License: MIT license  

Three different master-slave SPI examples implemented for the PIC18F and PIC32MX - barebones, using interrupts and with slave returning data. PICs are used as both master and slave.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "SPI master slave party pack" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "SPI master slave party pack" changes.

Do you want to report abuse regarding "SPI master slave party pack".

  • Information
  • Comments (0)

Example Blog

Just released my first libstock example, the SPI master slave party pack!

This pack contains three different master-slave SPI examples. All examples have been implemented on both the PIC18F and the PIC32MX, and though they have only been tested with different master and slave MCUs (PIC18F as master and PIC32MX as slave or vice versa), they should also work between two MCUs from the same family (famous last words...).

The PIC18F has been tested with a PIC18F458 running at 20MHz (NB - not default crystal) on an EasyPIC3.
The PIC32MX has been tested with a PIC32MX795F512L runnint at 80MHz on an EasyPIC Fusion v7

The three examples are as follows:

1) Simple master/slave
=========================
A barebones master sending data that is received by an absolutely minimal slave. This example will let you confirm that your setup works as it should without starting to mess around with interrupts etc. It is however probably not what you want to use in real life.

Projects needed:
  Master: PIC18F SPI master or PIC32MX SPI master
  Slave: PIC18F SPI slave or PIC32MX SPI slave

2) Simple master/slave with interrupts
========================================
A barebones master sending data that is received by slave that detects input using interrupts. This is way more efficient and is a nice building block if you want a slave that receives commands witout responding to them, like a motor controller or led sign output controller etc.

Projects needed:
  Master: "PIC18F SPI master" or "PIC32MX SPI master"
  Slave: "PIC18F SPI slave" with interrupt or "PIC32MX SPI slave with interrupt"

3) Master/slave with two way data transfer
============================================
A master that can read data back from the slave and a slave that returns data when it receives a 'get data' command. This will let you build a slave that can return a reading, internal state etc.

Projects needed:
  Master: "PIC18F SPI master reading slave response" or "PIC32MX SPI master reading slave response"
  Slave: "PIC18F SPI slave" with response or "PIC32MX SPI slave with response"

RELATED CODES

HOW TO USE THE VIRTUINO APP WITH AN ESP8266, A PIC18F AND MIKROC

0

HOW TO USE THE VIRTUINO APP WITH AN ESP8266, A PIC18F AND MIKROC SUBSCRIBE TO MY YOUTUBE CHANNEL VIDEOS: https://www.youtube.com/watch?v=hYOcU9um390&amp;t=73s https://youtu.be/X1BTHDG2UUE

[Learn More]

UART Protocol - UART Protokolü

0

UART İletişim protokolü- PIC donanımından bağımsız olarak UART Communication protocol. Apart from PIC hardware

[Learn More]

Serial Modbus Master

4

This project demonstrates a Modbus Master implementation, it has been developed and tested for a P18F45K22 using an EasyPic v7 for testing and written in mikcroC.

[Learn More]