please help. i don't know if is a wiring problem or software problem. i used lcd and uart for debugging.
when i used fatFs the program stuck on "res = f_open(&Fil, "file.txt", FA_OPEN_EXISTING | FA_READ);" and sometimes stock on "f_gets(buff, 10, &fil);"
, nothing came out from lcd neither uart. i have turn off one of uart/lcd to see the program still stuck or not. and i put print to the end program before while(1) to see the program is stuck or cannot transmit the data to uart/lcd.
but when my finger touching on pin sck-cs-mosi the program run flawless. and once program can read poem.txt then i push the reset button, the program still good. but the problem came again when i plug off the power button and plug it in again. the program stuck again. if i add more sentence on poem.txt the program became worst although after i push the reset button, but when i hold my finger on pin sck-miso-mosi the progrom running good. i thought this is a power failure so i add delay for vcc to catch up and cap. but still has same problem. but what make me think this is not the power failure is, once the program can read poem.txt with my finger touching pin sck-miso-mosi the program work fine although if i don't touch again with my finger and reset the micro without touching that pin again.
i disable the timer for "disk_timerproc();" using atmega328, 8mhz internal clock, using Sandisk 2GB microSD with Fat32 with 5 txt files inside that.
when the program stuck for 3-5 second and touch the pin program work again. after that, the program still work until i plug off and in again the power. any clue? maybe the type of microsd? or formating the fat32? note : i found new clue. if im not plug the micro SD the program still stuck, and soon when i thouch the pin, the program transmit "initialize error" which means the program is not stuck on f_open or f_gets.
* Moved out of the Tutorial thread. Moderator *