Page 1 of 1
Flowcode SPI component to max7219
Posted: Tue Oct 23, 2012 5:59 pm
by rider
Hi members,
I want to send my frequncy counter data from flowcode5 to seven segment LCD driver Max7219. The LCD displays are 3 nos. Each 6 digits. The MCU is 16f877A with SPI interface. I am new to this interface. I appreciate if someone helps me how to use the SPI component in FC to output the segment information.
regards
rider
Re: Flowcode SPI component to max7219
Posted: Tue Oct 23, 2012 6:46 pm
by kersing
1) The MAX7219 is an LED driver, not an LCD driver.
2) Could you sign up for the Flowcode 5 forum and post over there?
To drive the MAX7219:
First you need to connect the appropriate PINs for SPI and a generic I/O pin for LOAD. Each MAX7219 needs a different I/O pin for LOAD to enable addressing them individually.
Generic way to do this:
Code: Select all
Set all LOAD pins high
SPI_Init()
Drive LOAD pin low.
If you want to use decode mode:
Code: Select all
SPI_Send_Char(0x09)
SPI_Send_Char(0xFF)
To display a digit:
Code: Select all
SPI_Send_Char(address in lower nibble)
SPI_Send_Char(digit to display according to table 5 or 6)
Drive LOAD pin high.
For each digit you want to display you repeat:
Code: Select all
Drive LOAD pin low.
SPI_Send_Char(address in lower nibble)
SPI_Send_Char(digit to display according to table 5 or 6)
Drive LOAD pin high.
With the appropriate LOAD pin, address and digit information.
Re: Flowcode SPI component to max7219
Posted: Wed Oct 24, 2012 4:58 am
by rider
Hi Kersing,
Thankyou for the support. Could you please give me an simple example of how this is implemented in FC flowchart.
Rider