دستورات کار با mmc در کد ویژن چیه؟اصلا چه جوری باید از روی mmc یه فایل رو خوند یا نوشت؟منظورم اینه که مبانیش چیه؟توی این کدویژن ورژن 2.05.3 وقتی lcd گرافیکی رو فعال می کنیم یه چیزایی راجع به mmc میاره اما نمی دونم چه جوری باید از توابعش استفاده کرد؟
نمایش نسخه قابل چاپ
دستورات کار با mmc در کد ویژن چیه؟اصلا چه جوری باید از روی mmc یه فایل رو خوند یا نوشت؟منظورم اینه که مبانیش چیه؟توی این کدویژن ورژن 2.05.3 وقتی lcd گرافیکی رو فعال می کنیم یه چیزایی راجع به mmc میاره اما نمی دونم چه جوری باید از توابعش استفاده کرد؟
سلام:hi:
مهندس خودتون برنامه اي نوشتيد؟ لطفا همون برنامه اي كه الان اجرا گذاشتيد رو بذاريد تا رو همون بحث كنيم.
من فقط می خوام یه عکس رو از روی mmc بخونم و روی lcd نشون بدم.یا عکسی رو که از lcd خوندم روی mmc ذخیره کنم.
کسی نمی خواد جواب بده؟
سلام برای کتابخانه fat کد ویژن تو اینترنت مقاله هست تو سایتهای دیگر زیاد دیدم بحث شده باشه شما یک سرچ کن پیدا میکنی.
سلام دوستان
من دنبال یک کتابخانه خوب برای mmc در کدویژن هستم. اگر کسی داره لطفا" بزاره اینجا.
من یکی پیدا و دانلود کردم ولی در کدویژن 2.05.3 خطا میگیره و اجرا نمیشه. cry::
از کتابخانه FF استفاده کن. خیلی راحت و عالی هست. fat 32 هم ساپورت میکنه
من هم از کتابخانه ffنتونستم استفاده کنم
کسی کتابخانه mmc برای کدویژن نداره که درست کار کنه ؟
توی خود کدویژن ورژن 2.04 به بعد حداقل می دونم خودش کتابخونه داره برای کار با فلش مموری. که اونم همین کتابخونه fat fs(ff) معروف هست.
این کتابخونه تو همون پروژه mp3 player هست برا کد ویژن. پیداش نکردی بگو بزارمش اینجانقل قول:
مهندس زحمتش را بکش و بزار اینجا.نقل قول:
نوشته اصلی توسط behnam6500 [Dear Guest/Member you can't see link before replyclick here to register]
سلامنقل قول:
نوشته اصلی توسط alireza9900 [Dear Guest/Member you can't see link before replyclick here to register]
من هم این تنظیمات را دیدم ولی روش استفاده ار آنرا بلد نیستم
اگر کسی اطلاع داره لطفا" توضیح دهد
با تشکر
:0013: کسی نیست جواب بده ؟
دوست عزیز شما برو[Dear Guest/Member you can't see link before replyclick here to register]از اول تا اخرشو بخون متوجه میشی
سلام
من مدار رو میبندم اما بیشتر زمان ها FR_INT_ERR رو میده
برنامه های ساده رو امتحان میکنم با سوکت های مختلف هم امتحان کردم
مشکل از برنامه نیست ممکنه از سخت افزار باشه (اما بعضی مواقع درست کارمیکنه )
اینم مثال خود کدویژن
کد:
/* ATmega128 I/O register definitions */#include <mega128.h>
/* FAT on MMC/SD/SD HC card support */#include <ff.h>
/* printf */#include <stdio.h>
/* string functions */#include <string.h>
/* Timer1 overflow interrupt frequency [Hz] */#define T1_OVF_FREQ 100/* Timer1 clock prescaler value */#define T1_PRESC 1024L/* Timer1 initialization value after overflow */#define T1_INIT (0x10000L-(_MCU_CLOCK_FREQUENCY_/(T1_PRESC*T1_OVF_FREQ)))
/* USART Baud rate */#define BAUD_RATE 19200#define BAUD_INIT (_MCU_CLOCK_FREQUENCY_/(BAUD_RATE*16L)-1)
/* 100Hz timer interrupt generated by ATmega128 Timer1 overflow */interrupt [TIM1_OVF] void timer_comp_isr(void){/* re-initialize Timer1 */TCNT1H=T1_INIT>>8;TCNT1L=T1_INIT&0xFF;/* MMC/SD/SD HC card access low level timing function */disk_timerproc();}
/* error message list */flash char * flash error_msg[]={"", /* not used */"FR_DISK_ERR","FR_INT_ERR","FR_INT_ERR","FR_NOT_READY","FR_NO_FILE","FR_NO_PATH","FR_INVALID_NAME","FR_DENIED","FR_EXIST","FR_INVALID_OBJECT","FR_WRITE_PROTECTED","FR_INVALID_DRIVE","FR_NOT_ENABLED","FR_NO_FILESYSTEM","FR_MKFS_ABORTED","FR_TIMEOUT"};
/* display error message and stop */void error(FRESULT res){if ((res>=FR_DISK_ERR) && (res<=FR_TIMEOUT))printf("ERROR: %p\r\n",error_msg[res]);/* stop here */while(1);}
/* will hold file/directory information returned by f_readdir*/FILINFO file_info;
/* recursively scan directory entries and display them */FRESULT directory_scan(char *path){/* will hold the directory information */DIR directory;/* FAT function result */FRESULT res;int i;
if ((res=f_opendir(&directory,path))==FR_OK){while (((res=f_readdir(&directory,&file_info))==FR_OK) &&file_info.fname[0]){/* display file/directory name and associated information */printf("%c%c%c%c%c %02u/%02u/%u %02u:%02u:%02u %9lu" " %s/%s\r\n",(file_info.fattrib & AM_DIR) ? 'D' : '-',(file_info.fattrib & AM_RDO) ? 'R' : '-',(file_info.fattrib & AM_HID) ? 'H' : '-',(file_info.fattrib & AM_SYS) ? 'S' : '-',(file_info.fattrib & AM_ARC) ? 'A' : '-',file_info.fdate & 0x1F,(file_info.fdate >> 5) & 0xF,(file_info.fdate >> 9)+1980,file_info.ftime >> 11,(file_info.ftime >> 5) & 0x3F,(file_info.ftime & 0xF) << 1,file_info.fsize,path,file_info.fname);if (file_info.fattrib & AM_DIR){/* its a subdirectory *//* make sure to skip past "." and ".." when recursing */if (file_info.fname[0]!='.'){i=strlen(path);/* append the subdirectory name to the path */if (path[i-1]!='/') strcatf(path,"/");strcat(path,file_info.fname);/* scan subdirectory */res=directory_scan(path);/* restore the old path name */path[i]=0;/* remove any eventual '/' from the end of the path */--i;if (path[i]=='/') path[i]=0;/* stop if an error occured */if (res!=FR_OK) break;}}}}return res;}
void main(void){/* FAT function result */FRESULT res;/* will hold the information for logical drive 0: */FATFS drive;/* root directory path */char path[256]="0:/";
/* initialize Timer1 overflow interrupts in Mode 0 (Normal) */TCCR1A=0x00;/* clkio/1024 */TCCR1B=(1<<CS12)|(1<<CS10);/* timer overflow interrupts will occur with 100Hz frequency */TCNT1H=T1_INIT>>8;TCNT1L=T1_INIT&0xFF;/* enable Timer1 overflow interrupt */TIMSK=1<<TOIE1;
/* initialize the USART0 TX, 8N1, Baud rate: 19200 */UCSR0A=0;UCSR0B=1<<TXEN0;UCSR0C=(1<<UCSZ01)|(1<<UCSZ00);UBRR0H=BAUD_INIT>>8;UBRR0L=BAUD_INIT&0xFF;
/* globally enable interrupts */#asm("sei")
printf("Directory listing for root of logical drive 0:\r\n");
/* mount logical drive 0: */if ((res=f_mount(0,&drive))==FR_OK)printf("Logical drive 0: mounted OK\r\n");else/* an error occured, display it and stop */error(res);
/* repeateadly read directory entries and display them */if ((res=directory_scan(path))!=FR_OK)/* if an error occured, display it and stop */error(res);
/* stop here */while(1);}
سلام
اینجا یک مثال گذاشتم
[Dear Guest/Member you can't see link before replyclick here to register]
برنامه مشکلی نداره
عیب مدار اینه که همیشه صحیح جواب نمیده و هر چند بار FR_INT_ERR داره
سوالم این بود که همیشه کار با مموری اینطوریه یا سخت افزار مشکل داره
اینم چند تا خروجی که پشت سر هم گرفتم
[Dear Guest/Member you can't see link before replyclick here to register]
من دنبال اینم که همیشه کار کنه و این erorr ها رو حذف کنم
سلام دوست عزیز این خطای fr_int_err مربوط به اشتباه بودن استراکچر fat و یا خطای داخل برنامه می باشد.