Hi Martin,
We have a requirement of designing a SPI driver for MPC5748g, could you please share any reference SPI driver code for MPC5748g.
Regards
Sandeep Nagarajan
Hi Sandeep martinkovarsandeepvl
Thanks for sharing, but i have few queries:(In regard to AN4830 doc)
1. i dont understand why below functions are used, (In regard to AN4830 doc)
memory_config_160mhz(); /* Config wait states, flash master access, etc*/
crossbar_config(); /* Config crossbar */
2. Under system clock configuration function:void PLL_160MHz(void) (In regard to AN4830 doc)
PLLDIG.PLLDV.B.PREDIV = 1;
PLLDIG.PLLDV.B.MFD = 16;
PLLDIG.PLLDV.B.RFDPHI = 1;
PLLDIG.PLLCAL3.R = 0x09C3C000; //MFDEN =9999
This configuratation gives me the 16kHz as the system & PLL clock,
But we are supposed to configure for 160Mhz.
3. As per the RM of MPC5748g, the F80 & F40 is used a peripheral clocks for DSPI & SPI Modules,
the corresponding MC_CGM.AC0_DC4 & MC_CGM.AC0_DC3 are used to configure for F80 & F40,
where once i configure these two dividers, i am facing the scene where my debugger takes the flow
to cpu idle state(error handling conditions).
It would be helpful if i get any leads regarding the issue.
Regards
Sandeep Nagarajan
Please have a look at this. MPC5748G : SPI ISR sample code
It helped me. The example code for MPC5748G is basically a loop back test.