Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Why can't use the MSSP2 module for the SPI protocol

Status
Not open for further replies.

saramah

Member level 3
Joined
Apr 25, 2018
Messages
64
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
689
Hi all, I

I am using compiler CCS (v5.008) and MCU PIC18F46k22(has 2 MSSP module) , to display text in P10-DMD using MSSP2 module of the MCU.

---My target to use MSSP1 for hardware I2C (for RTC clock) and MSSP2 for hardware SPI (to display clock data in DMD).-----

For that, FIRST going to setup Hardware SPI for DMD with MSSP2 Module,

All things are going correct if MSSP1 is used with the code below SPI configuration---

Code:
#use SPI(SPI1, MODE = 0, BITS = 8, STREAM = P10_Panel_Driver)


but if MSSP2 is configure with below, the the MSSP2 for SPI is not working even SCK2 pin is not responding.

Code:
#use SPI(SPI2, MODE = 0, BITS = 8, STREAM = P10_Panel_Driver)


Is there anythings what i am missing to setup MSSP2.

Anyone can help me?

Thanks
 

Hi,

I'm not familiar with PIC.
But for SPI you need a clock frequency setup.

Klaus
 

But for SPI you need a clock frequency setup.
Default clock speed with CCS C #use SPI is fosc/4.

but if MSSP2 is configure with below, the the MSSP2 for SPI is not working even SCK2 pin is not responding.
I don't recognize a problem with SPI2 setup in more recent CCS C V5 versions. Either there's a bug in V5.008 or you have an issue in your hardware design or code, e.g. overwriting TRISD after initial setup. I would check the actual SFR values in hardware debugger or simulator.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top