Page 1 of 1
read sd card and write to lcd screen
Posted: Sat Jul 23, 2022 11:49 am
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
Re: read sd card and write to lcd screen
Posted: Sat Jul 23, 2022 2:39 pm
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 (151.28 KiB) Viewed 2200 times
For example, you have got MOSI remapped to C.5, however, on the
Eblock2 datasheet it's showing as C.3, etc.
Re: read sd card and write to lcd screen
Posted: Sun Jul 24, 2022 9:35 am
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
Re: read sd card and write to lcd screen
Posted: Sun Jul 24, 2022 1:56 pm
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.