read sd card and write to lcd screen

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Maverick
Posts: 68
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:58 am
Has thanked: 27 times
Been thanked: 8 times

read sd card and write to lcd screen

Post by Maverick »

I’m trying to read a text file from sd card and display text on lcd display
The software works fine in the simulator but when I build and download to BL0080 pic programmer, eb005 lcd display on port B and bl0154 sd card on port c it starts off ok saying waiting for card but does nothing when I insert sd card with test.txt file on. Setup picture and Flowcode program based on program from wiki page attached
Attachments
gm_FAT_Read_File.fcfx
(15.85 KiB) Downloaded 50 times
sd_card_setup.jpg
sd_card_setup.jpg (119.45 KiB) Viewed 998 times

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: read sd card and write to lcd screen

Post by medelec35 »

Hello.
I have not got an eblocks2 micro sd card reader for testing.
But, I have noticed within your property connections the reader does not match the settings within the datasheet:
SD reader connections.png
SD reader connections.png (151.28 KiB) Viewed 988 times
For example, you have got MOSI remapped to C.5, however, on the Eblock2 datasheet it's showing as C.3, etc.
Martin

Maverick
Posts: 68
Joined: Wed Dec 02, 2020 10:58 am
Has thanked: 27 times
Been thanked: 8 times

Re: read sd card and write to lcd screen

Post by Maverick »

Hi
thanks for the fast response
I have tried that and it made no difference, interestingly the simulator still ran ok.
I then tried changing the channel to software which has the same port settings fixed, this works fine when downloaded, so I'm confused
I chose my port settings based on the pic chip actual spi pins as i thought flowcode would use them. Does this mean flowcode doesn't use a micros spi pins and how does this work in real life as most micros have dedicated spi pins

medelec35
Matrix Staff
Posts: 1451
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: read sd card and write to lcd screen

Post by medelec35 »

The bits for the Ebock2 card reader are fixed and can't be changed.
Eblocks2 is designed for rapid prototyping.
The idea is you get the project to work and then you use your own hardware which can be connected to any pin of the microcontroller of course.
Maverick wrote:
Sun Jul 24, 2022 9:35 am
I chose my port settings based on the pic chip actual SPI pins
With the 16F18877 there are some peripherals that can be changed to work on different pins, there is not a dedicated set pin.
For example channel1 SPI, you can select MOSI to be assigned to pins C0 to C7 or B0 to B7, that is why the SPI connections going to the card reader are fixed.
Therefore you select the pins for SPI that are shown on the datasheet.
The card reader should work with SPI in hardware mode as this will be much quicker than running in software mode.
If you had a much older microcontroller that has fixed SPI pins then you can use an Eblock2 card reader with a BL0161 - Manual Patch Eblock2 or use SPI in software mode, which won't be as good as stated earlier.
Martin

Post Reply