Page 1 of 1

Card Reader

Posted: Thu Feb 23, 2012 2:34 pm
by JohnCrow
Hi
Not sure if ive missed a post or bug fix, but Im not able to get the card reader to work in FC5 (patch installed)

If I try it in hardware mode I get random characters on the lower line of the lcd, and just waits
Software mode does not do anything just sits waiting for card
Tried Sandisk class 2 (from matrix) and panasonic class 4 cards

The program works fine in FC4
This is an edited version of my whole flowchart to just leave the card reader part.
Cardtest-FC4-Works.fcf
FC4-working version
(11.61 KiB) Downloaded 363 times
Tried various configurations of the flowchart and have not been able to get it to even just create a file.
Suspect I must be overlooking something obvious

Thanks

Re: Card Reader

Posted: Tue Feb 28, 2012 4:46 pm
by Benj
Hi John,

Sorry for the delay some fixes are now available from here.
http://www.matrixmultimedia.com/mmforum ... 163#p33034

Re: Card Reader

Posted: Mon May 07, 2012 2:10 pm
by JohnCrow
Hi
Im still having problems with the card reader.
Ive done some tests and these are the results

They are still present after installing V5.2 (clean install, not patched)
I have set a simple program to create a txt file, open it and append a simple txt string.

I have the card reader on PortA for all tests - Jumper on A
PIC18F4550

All set to FAT 16
Software mode is set as
CS Bit2
Clock Bit3
Data In Bit 4
Data out Bit 5

Hardware Mode
CS Bit2

Test 1 & Test 2
Cardreader in software mode & LCD on Port B
Cardreader in software mode & LCD on Port D
Works ok Gives retvval = 0 on file create

Test 3
Cardreader in hardware mode & LCD on Port B
This gives random characters on the LCD , and does not write to card

Test 4
Cardreader in Hardware mode & LCD on Port D
Gives retval 238 on file create and does not create file
But does not put random characters on LCD
Create_open_write-works-softwaremode.fcf
(9 KiB) Downloaded 349 times
Create_open_write-Hardware mode-portd.fcf
(9 KiB) Downloaded 336 times
Create_open_write-Hardware mode.fcf
(9 KiB) Downloaded 308 times

Re: Card Reader

Posted: Tue May 08, 2012 3:49 pm
by Benj
Hi John,

When the FAT16 component is in hardware mode it uses the SPI peripheral pins on the chip. For the 18F4550 device these pins are as follows.

SDO - RC7
SDI - RB0
SCK - RB1

Using hardware mode the only pin that is freely available to be moved around is the chip select pin.

This explains why you are getting LCD corruption when this is connected to PortB in hardware mode.

Re: Card Reader

Posted: Tue May 08, 2012 4:14 pm
by JohnCrow
Thanks Benj