GLCD and

General discussion on mikroPascal PRO for ARM.
Post Reply
Author
Message
corado
Posts: 399
Joined: 28 Mar 2009 11:03

GLCD and

#1 Post by corado » 26 Jan 2021 19:56

Hi,
I hope the SPI GLCD lib is compatible to the ST7920 LCD?
But anyway, there are another problem--
The problem is Spi1_Init_Advanced...

If I do this

Code: Select all

 program Bluepill;

{ Declarations section }
{// LCD module connections
var LCD_RS : sbit at GPIOB_ODR.B4;
var LCD_EN : sbit at GPIOB_ODR.B5;
var LCD_D4 : sbit at GPIOB_ODR.B6;
var LCD_D5 : sbit at GPIOB_ODR.B7;
var LCD_D6 : sbit at GPIOB_ODR.B8;
var LCD_D7 : sbit at GPIOB_ODR.B9;
// End LCD module connections }

//*************************************************************************
// Port Expander module connections
var SPExpanderRST : sbit at GPIOB_ODR.B0;
    SPExpanderCS  : sbit at GPIOB_ODR.B1;
// End Port Expander module connections


// Initialize SPI module used with PortExpander
SPI1_Init_Advanced(_SPI_FPCLK_DIV4, _SPI_MASTER or _SPI_8_BIT or
                   _SPI_CLK_IDLE_LOW or _SPI_FIRST_CLK_EDGE_TRANSITION or
                   _SPI_MSB_FIRST or _SPI_SS_DISABLE or _SPI_SSM_ENABLE or _SPI_SSI_1,
                   @_GPIO_MODULE_SPI1_PB345);
//*************************************************************************
I get this
21 304 Syntax error: Expected ":" but "(" found Bluepill.mpas
21 337 Unknown type "_SPI_FPCLK_DIV4" Bluepill.mpas
21 314 Identifier "SPI1_Init_Advanced" has been already declared in "__Lib_SPI_123_3XX.mpas" Bluepill.mpas
21 301 ","is not valid identifier Bluepill.mpas
21 304 Syntax error: Expected ";" but "_SPI_MASTER" found Bluepill.mpas
21 304 Syntax error: Expected "." but "or" found Bluepill.mpas

0 102 Finished (with errors): 26 Jan 2021, 19:50:32 Bluepill.mppar

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: GLCD and

#2 Post by filip » 05 Feb 2021 09:54

Hi,

You need to place a call to the SPI1_Init_Advanced function in some procedure or function, like this :

Code: Select all

 program Bluepill;

{ Declarations section }
{// LCD module connections
var LCD_RS : sbit at GPIOB_ODR.B4;
var LCD_EN : sbit at GPIOB_ODR.B5;
var LCD_D4 : sbit at GPIOB_ODR.B6;
var LCD_D5 : sbit at GPIOB_ODR.B7;
var LCD_D6 : sbit at GPIOB_ODR.B8;
var LCD_D7 : sbit at GPIOB_ODR.B9;
// End LCD module connections }

//*************************************************************************
// Port Expander module connections
var SPExpanderRST : sbit at GPIOB_ODR.B0;
    SPExpanderCS  : sbit at GPIOB_ODR.B1;
// End Port Expander module connections

begin
// Initialize SPI module used with PortExpander
SPI1_Init_Advanced(_SPI_FPCLK_DIV4, _SPI_MASTER or _SPI_8_BIT or
                   _SPI_CLK_IDLE_LOW or _SPI_FIRST_CLK_EDGE_TRANSITION or
                   _SPI_MSB_FIRST or _SPI_SS_DISABLE or _SPI_SSM_ENABLE or _SPI_SSI_1,
                   @_GPIO_MODULE_SPI1_PB345);
//*************************************************************************
end.
Regards,
Filip.

Post Reply

Return to “mikroPascal PRO for ARM General”