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
read sd card and write to lcd screen
-
- Posts: 69
- 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
- Attachments
-
- gm_FAT_Read_File.fcfx
- (15.85 KiB) Downloaded 333 times
-
- sd_card_setup.jpg (119.45 KiB) Viewed 2208 times
-
- Matrix Staff
- Posts: 1921
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 623 times
- Been thanked: 645 times
Re: read sd card and write to lcd screen
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: For example, you have got MOSI remapped to C.5, however, on the Eblock2 datasheet it's showing as C.3, etc.
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: For example, you have got MOSI remapped to C.5, however, on the Eblock2 datasheet it's showing as C.3, etc.
Martin
Re: read sd card and write to lcd screen
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
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
-
- Matrix Staff
- Posts: 1921
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 623 times
- Been thanked: 645 times
Re: read sd card and write to lcd screen
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.
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.
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.
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