Closed mirapira closed 5 years ago
Hi,
Thanks for the report, I haven't touch this component for a while but I will add your patch.
@mirapira Fixed with your suggestion.
As you have noticed this component works only with the SCB based SPI component. I had gained some knowledge with the (nRF24 Component) about doing components that works with both SCB and UDB based SPI.
I will start working on a new Nokia 5110 component with such behavior, if you are interested see Nokia5110 Component, i will work on it this week.
Hi, I had an issue using your code in a Psoc4 (4245LQI). It seems that the commands and data were getting mixed up on the SCB buffer. I had this issue before with a NRF24. Forcing the CE to drop from byte to byte is not enough, and by the time the command pin is asserted, the SCB was still sending data from previous commads.
The fix is very simple: Check for the idle state before sending data to SCB(or SCB buffer). Check the bold code. Thanks, Marco
/-------------------------------------------------------------------------------------------------- // Name :
$INSTANCE_NAME
_SendData // Description : Sends data to display controller. // Argument(s) : data -> Data to be sent // Return value : None. //--------------------------------------------------------------------------------------------------/ void$INSTANCE_NAME
_SendData(uint8_t data){ while($INSTANCE_NAME
_SPI_SpiIsBusBusy()); // Wait until SPI cycle complete.$INSTANCE_NAME
_Control_Write(SET_RST_SET_DC);$INSTANCE_NAME
_SPI_SpiUartWriteTxData(data); // Send data to display controller. while($INSTANCE_NAME
_SPI_SpiIsBusBusy()); // Wait until SPI cycle complete. }/-------------------------------------------------------------------------------------------------- // Name :
$INSTANCE_NAME
_SendCommand // Description : Sends command to display controller. // Argument(s) : command -> Command to be sent // Return value : None. //--------------------------------------------------------------------------------------------------/ void$INSTANCE_NAME
_SendCommand(uint8_t command){ while($INSTANCE_NAME
_SPI_SpiIsBusBusy()); // Wait until SPI cycle complete.$INSTANCE_NAME
_Control_Write(SET_RST_CLEAR_DC);$INSTANCE_NAME
_SPI_SpiUartWriteTxData(command); // Send command to display controller. while($INSTANCE_NAME
_SPI_SpiIsBusBusy()); // Wait until SPI cycle complete. }