Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC Microcontroller select program to load from SD Card

Not open for further replies.


Junior Member level 1
Nov 2, 2009
Reaction score
Trophy points
Activity points
I would like to build a PIC project using PIC18F4553 with the below features.

1. USB interface so communicate with PC host application for bidirectional real time data exchange, which can be further process on PC,

e.g. Analogue or Digital Scope channels.

2. Use LCD and select buttons on board to run the program from the SD card attached using SPI interface with µc. The SD card has multiple programmes having different port settings as per the program requirement.

e.g. first program read this port as 5 analogue channels
second program use this port for 5 digital channels

Analogue - Digital
PIN µc pins
1 || 2 A-D
2 || 3 A-D
3 || 4 A-D
4 || 5 A-D
5 || 6 A-D

Third program use µc to control motors
Forth program use µc to TX as remote control

Motor control /remote control
1 || 15 D
2 || 16 D PWM2
3 || 17 D PWM1
4 || 25 D TX

The beauty is that we just need to update or add as many as hex files on the SD card and on runtime we select which program we now want to run on µc, its actually give me a feeling of a micro gadget box in my pocket.
I read lot of threads and googling a lot and end up with the option of multitasking operating systems. either one. But when I read in detail I have to include all the programme on the time of compilation and all of them then run in parallel ....

I actually want to run an application from SD card when I want it to run and I can add remove modify the card any time like we do in PC's, Have OS and then we install applications and remove applications. Something like that with PIC.

Thanks in advance. :oops: ∞∞∞ΩµΠφΔΘΛΣΦΨβδζψηθλξσω²§∑∫∞∞∞

What you need is similar to a standard run-time bootstrap type application (see link). You will need to modify the code to load the programs from the SPI bus connected SD card instead of the serial port. That should take care of most of your requirements. See other Microchip application notes to address your other requirements.

Thanks for the prompt reply grieblm. I am actually a conceptual electronics modular designer and doing this for my personal LAB. I read the link you inserted in the post( thanks again), but it will not fulfill the need i am looking for. Giving a bit more detail idea i want a personal kit of PIC with LCD and control buttons. The PIC shows a shell on a screen which list the files stored in SD card. And when we select a file it runs it as a main program in the PIC and the I/O are configured and run as per the hex files of the SD card. when want to terminate the program we quit it and the shell come back and shows the list of files in the SD card and we start again with different file. ITs like we have multiple programes files on SD card and the shell giving us the ability to read the list of files and execute them and when we donot want them terminating them and allow us to run another file program. Thanks in Advance for all the answers.

Hmm i see no body is interested here in creativity still waiting for the options to resolve the issue. Waiting for someone advace level to take some time off to look on something different i am asking here.

Apart from telling your requirements, you should also ask, if they are feasible with a particular microcontroller family. Most PIC18 processor are only able to execute code from internal flash memory. So besides all handling details, the flash has to be reprogrammed when changing the code. This is referring to the bootloader operation mode, grieblm mentioned. It's considerably different from what's done with a PC or a microprocessor that runs the code from RAM.

There are a few PIC18 types, e.g. 18F67J50, that can also execute code from a external RAM. It would be better suited for your intention.

Standard PIC18 processors support up to 100k flash reprogram cycles, so it would be possible to implement your scheme in a bootloader manner. Having the application select shell as part of the bootloader and return to it when finishing the application don't have other prerequisites than a sufficient amount of code flash and shouldn't be a problem.
  • Like
Reactions: smraise


    Points: 2
    Helpful Answer Positive Rating
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to