I use two SPI: one (SPI2) for transfer image data from MMC to MCU's internal RAM, another (SPI4) - for transferring data from MCU RAM into TFT controller's SRAM. Since MCU RAM has not enough volume, data transferred by many pieces. Since I use two SPI, I must apply presented in SPI library SPI_Set_Active procedure to activate SPIs.
It is very complicated, because switching SPI2 -> SPI4 -> SPI2 -> SPI4 ->...occurs very often, overloads the code and takes a lot of execute time.
Questions:
1. Is it possible to activate SPIs not during code execution process sequently, but at one time, before data transferring, somewhere in Initialization phase?
2. What for need the SPI_Set_Active procedure at all, since used SPIs pointed explicitly: SPI2, SPI4? If I use SPI2, I dont use SPI4 and vise versa...
Is it possible to eliminate use of SPI_Set_Active?
Re: Is it possible to eliminate use of SPI_Set_Active?
hi,
what is the target please ?
the first PIC32 I found with 4 SPI are in the PIC32MZ serie that are not supported for now
regards
what is the target please ?
the first PIC32 I found with 4 SPI are in the PIC32MZ serie that are not supported for now
regards
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: Is it possible to eliminate use of SPI_Set_Active?
Hello,
If you project(code) doesn't use generalized SPI functions - SPI_Write, SPI_Read.
Then you don't need to use SPI_Set_Active function.
You can simple use SPI functions with designated module number.
Best regards.
If you project(code) doesn't use generalized SPI functions - SPI_Write, SPI_Read.
Then you don't need to use SPI_Set_Active function.
You can simple use SPI functions with designated module number.
Code: Select all
// Transfer image to MMC
SPI2_Read()
...
// Transfer image to TFT
SPI4_Write()
...
Re: Is it possible to eliminate use of SPI_Set_Active?
Hm-m-m...
But if I have only one SPI and use generalized SPI functions - SPI_Write, SPI_Read, I the more don't need this (SPI_Set_Active) function, isn't it?
So as and when there is more than one SPI with different numbers...
A?
But if I have only one SPI and use generalized SPI functions - SPI_Write, SPI_Read, I the more don't need this (SPI_Set_Active) function, isn't it?
So as and when there is more than one SPI with different numbers...
A?
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: Is it possible to eliminate use of SPI_Set_Active?
Hi,
If you use generic routines, SPI_Read() and SPI_Write() you need to use SPI_Set_Active() routine with which you "activate"
one of the SPI modules (if you use more then one SPI module and/or if MCU which you use have more then one SPI module).
But if you do not want to use SPI_Set_Active() routine, you simple can use SPI functions with designated module number,
like my colleague already explained.
Best regards,
Marina
If you use generic routines, SPI_Read() and SPI_Write() you need to use SPI_Set_Active() routine with which you "activate"
one of the SPI modules (if you use more then one SPI module and/or if MCU which you use have more then one SPI module).
But if you do not want to use SPI_Set_Active() routine, you simple can use SPI functions with designated module number,
like my colleague already explained.
Best regards,
Marina
Re: Is it possible to eliminate use of SPI_Set_Active?
O'K...
Anyway thank you.
Anyway thank you.