Loading text file in PIC32 microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by DancinNancy, Feb 23, 2009.

  1. DancinNancy

    Thread Starter Member

    Oct 1, 2008
    24
    0
    I am working on a project for school and i am trying to make a program that reads a text file and depending on the numbers in the file, lights up the appropriate LED. For example if the text file had 3 4 1 then the third led would light then the second then the first. I am using a PIC32 microcontroller and writing the code in C. The microcontroller plugs in to the computer through usb and I'm am hoping this is a fairly simple task. Any help is appreciated. Thanks
     
  2. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    You need to interface the PIC to the PC first. I don't think the PIC32 supports USB interface, so you could go with something simpler, like RS232-USB chip, FTDI232 or CP210x from Silabs.

    Then you need to write the PC application to read the file and send the data to the PIC and write the firmware to act on the data and lights the LEDs.
     
  3. DancinNancy

    Thread Starter Member

    Oct 1, 2008
    24
    0
    What about loading the file through the program i'm writing with. I already have the microcontroller and the program used to write to it in c is MPLAB. What I want to do is in the code say load "example.txt" and then have a if loop depending on whats in the file. I know this is possible in c++ but I have know clue how to do it on this program. Anyone that knows please let me know this would help tremendously.
     
  4. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    That program runs in the microcontroller. The file you have is in your PC. How would the micro program accesses the PC file?
     
  5. DancinNancy

    Thread Starter Member

    Oct 1, 2008
    24
    0
    I want to just save it to the microcontroller. There would only be one txt file for the project I am doing but i want to do it this way as an example of how the project would read and respond to a txt file. It is for a senior project so it doesn't have to be perfect its more of a concept thing
     
  6. LesterPhil

    Member

    Feb 25, 2009
    10
    0
    you can do it using PIC16. If you'are implying that you were just give a dummy input to your system, just to test if it is posible, so there's no need to have a PC to feed an input? then it so simple...

    If it needs a PC, so maybe u need a GUI where you can feed your inputfile..
     
  7. DancinNancy

    Thread Starter Member

    Oct 1, 2008
    24
    0
    how do you do it on the pic16. I already have the pic32 but i would assume they wouldn't be too different
     
Loading...