Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - yokky7935

#1
ARM Processors / STM32F4 + LCD
April 25, 2015, 04:39:31 PM
ต้องการเขียนโปรแกรมแสดงข้อความทางLCD โดยใช้
LCD ->http://www.gaw.ru/pdf/lcd/lcm/Microtips/char/MTC-16204X.pdf
ต้องเริ่มเขียนอย่างไรคะ ขอตัวอย่างด้วยคะ
หากใช้ไลบราลี่ของคนอื่นแต่ LCD คนละรุ่นกันแต่ต่อ pin ต่างๆตามไลบราลี่นั้นจะสามารถใช้ได้ไหมคะ
http://stm32f4-discovery.com/2014/06/library-16-interfacing-hd44780-lcd-controller-with-stm32f4/ เป็นไลบราลี่ LCD คะ
#2
ต้องการนำเวลาจริงมาแสดงบนจอ
ในการใช้ไลบราลี่ RTC ต้องเซทค่าพอร์ตอะไรอย่างไรบ้าง
สั่งให้แสดงเวลาจริงอย่างไร
รบกวนขอตัวอย่างด้วยคะ
#3
การส่งข้อมูลผ่านพอร์ต uart ของ stm32f4 สามารถส่งข้อมูลเกิน 8bit ได้ไหมค่ะ
ถ้าได้ต้องเซทค่าอะไรค่ะ
#4
เขียนข้อมูลลง sdcard stm32f4 ทำไมเมื่อนำฟังก์ชันเขียนข้อมูลลงsdcardมาไว้ใน while(1)แล้วโปรแกรมไม่นำข้อมูลลงsdcardให้คะ
int main(void)
{
SystemInit();
LED_GPIOInitialize();
FRESULT L_RESULT;
FATFS obj_FATFS;  //Fatfs object
FIL fil;  //File object
uint32_t total, free;  //Free and total space
int a = 5555;
int b = 7935;
int c = 1234;

L_RESULT = f_mount(&obj_FATFS,"",1);
  if(L_RESULT == FR_OK)
  {
      // LED Green On
  GPIO_SetBits(GPIOD,GPIO_Pin_14);  // LED red
  //Try to open file
         if (f_open(&fil, "file.txt", FA_OPEN_ALWAYS | FA_READ | FA_WRITE) == FR_OK) {
             //File opened, turn off RED and turn on GREEN led
        GPIO_ResetBits(GPIOD,GPIO_Pin_14);
        GPIO_SetBits(GPIOD,GPIO_Pin_12); 
                 }

                 
  }

    while(1)
    {
                                                         f_printf(&fil, "%d\n", a);
        f_printf(&fil, "%d\n", b);
        f_printf(&fil, "%d\n", c);
                                                         f_close(&fil);
    }
}//end main
#5
ต้องการเขียนข้อมูลลงsd card ผ่านsdio ของstm32f4 discovery
โดยใช้ไลบราลี่จาก http://mikrocontroller.bplaced.net/wordpress/?page_id=621
ทดลองเขียนโค้ดดังนี้
#include "main.h"
#include "stm32_ub_fatfs.h"

int main(void)
{
  FIL myFile;   // Filehandler

  SystemInit(); // Quarz Einstellungen aktivieren

  // Init vom FATFS-System
  UB_Fatfs_Init();

  // Check ob Medium eingelegt ist
  if(UB_Fatfs_CheckMedia(MMC_0)==FATFS_OK) {
   // Media mounten
    if(UB_Fatfs_Mount(MMC_0)==FATFS_OK) {
      // File zum schreiben im root neu anlegen
      if(UB_Fatfs_OpenFile(&myFile, "0:/UB_File.txt", F_WR_CLEAR)==FATFS_OK) {
       // ein paar Textzeilen in das File schreiben
        UB_Fatfs_WriteString(&myFile,"Test der WriteString-Funktion");
        UB_Fatfs_WriteString(&myFile,"hier Zeile zwei");
        UB_Fatfs_WriteString(&myFile,"ENDE");
        // File schliessen
        UB_Fatfs_CloseFile(&myFile);
      }
      // Media unmounten
        UB_Fatfs_UnMount(MMC_0);
    }
  }

  while(1)
  {

  }
}

build ผ่าน download code ลง stm32f4 discovery ได้
แต่เมื่อนำsd card มาเปิดในคอมพิวเตอร์ไม่พบไฟล์ใดๆในsd cardเลย
เป็นเพราะอะไรค่ะ
#6
อยากสอบถามวิธีเขียนอ่านข้อมูลใน sdcard ผ่าน sdio ของ stm32f4
หรือขอตัวอย่างการเขียนอ่านข้อมูลใน sdcard ผ่าน sdio
ไม่รู้จะเริ่มยังไง และไม่รู้ว่าต้องเซ็ทค่าpinยังไงบ้างคะ
#7
อยากปรึกษาว่าหากทำโปรเจคaccess control โดยใช้ nfc ใช้ stm32f4 ในการคอนโทร
การที่จะนำ key id เก็บบันทึกว่า key ไหนสามารถเข้าได้บ้าง
อยากสอบถามว่าควรละเก็บ  key id ไว้ในไหนระหว่าง flash memoryของ stm32f4 หรือ sdcard
ข้อมูลที่จะเก็บคือ  key id และ เวลาที่สามารถเข้าออกได้
#8
อยากสอบถามว่าเราสามารถ read ค่าในflash memory ได้หรือไม่คะ ไม่เห็นฟังก์ชันในการ read เลย
ใช้ coocox ในการเขียนโปรแกรมค่ะ