How the Programs in stored in Microcontrollers

Status
Not open for further replies.

Prabakaran

Full Member level 3
Joined
Jan 22, 2007
Messages
167
Helped
9
Reputation
18
Reaction score
3
Trophy points
1,298
Location
Chennai(India)
Activity points
2,273
HI ALL
I HAVE A DOUBT REGARDING PROGRAMMING OF MICROCONTROLLERS. I KNOW THAT THE PROGRAMS DUMPED TO THE MICROCONTROLERS IS STORED IN FLASH MEMORY . THE SERIAL DOUNLOADING OF PROGRAM IN FORM OF HEX IS TRANSFERD TO MICRONTROLLER VIA RXD AND TXD.

HOW THE MICRONTROLLER DIFFERETIATE THAT COMMING HEX IS FOR PROGRAMMING THE MICRONTROLLER AND IS DIRECTLY MOVED TO FLASH MEMORY. THE SAME PIN IS USED FOR SEIAL INTTERUPT. COULD ANYONE CLEAR MY DOUBTS IT WOULD BE HELPFUL FOR MY REFRENCE.

THANKS
M.PRABAKARAN
 

In HEX file information about addresses are stored. Each uController have own memory map with is know for compiler. Base on that during compilation compiler know what addresses belongs to FLASH memory area and locate to this area code of program. Other types (EEPROM) of memory if exists are filled by data.
 

Not all the micros have a booloader to use the serial interface .Most of modern ones have a JTAG or ISP .interface ,,That's why they sell you a specific programmer.
 

hello

First the program is converted to intel hex file or motorola s record file by the assembler or the compiler

then this file is transfered to the microcontroller flash by many ways

1- parallel programming like the AT89C51
2- in circuit serial programming (ISP) like PIC microcontrollers
3- using bootloader which is a small program on the target microcontroller
communicates with the PC with RS232,CAN bus or even Ethernet
4- using JTAG interface

some microcontrollers have one way like AT89C51 which can be programmed only in parallel way, some have all these methods like AVR manufatured by ATMEL

best regards

Samport
 

Jarik

Thanks jarik , Now i got cleared how the programs is stored .Can we find the address of the flash memory , and can we directly end the data to the microcontroller will it work if we do like that .If it possible will the program start running immediately after it downloaded it to controller.
 

Usually the micro is put into some kind of programming mode. With flash pic's it is with 13 votls being applied to the MCLR pin. Then data is clocked into the flash memory with a SPI interface. New generation pic's can rad and write prigram memory directly. This is useful for stroring constant data like strings and other values that won't change often, It makes the eeprom data memory redundant. Anyway, you can actually rewrite your program memory space if you know what you are doing. For example you could send instructions to the pic from the computer by USB or RS-232 or whatever. The pic jumps to a piece of code that takes data that has an address field and a data field and places that data into program memory, thereby changing it's programming. Once and end of data being downloaded condition is met the pic could jump to its reset vector, memory location 0 and start running the new program. This could even be done over the internet. I believe Microchip has an application note on it, but you'd have to check that out.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…