90 likes | 253 Views
8051 Development System Details. Program Download. Program gets downloaded via a JTAG protocol to flash memory in the chip. Assembly / Compilation. Assemble/Compile – only assembles, used for initial debugging.
E N D
8051 Development System Details EE/CS-352: Embedded Microcontroller Systems
Program Download Program gets downloaded via a JTAG protocol to flash memory in the chip. EE/CS-352: Embedded Microcontroller Systems
Assembly / Compilation Assemble/Compile – only assembles, used for initial debugging. Build/Make Project – assembles and links (builds) files - only builds files that have changed since last build. Rebuild Active Project – forces a build of all files and their dependencies EE/CS-352: Embedded Microcontroller Systems
More details on the files generated blink.wsp - project file blink.asm - source file blink.LST - list file blink.OBJ - relocatable object file blink.M51 - linker map file BLINK - absolute object file - program that gets downloaded Linker map file (.M51) and absolute object file, are generated on each build/make, but they may be named with the base name of the first program compiled in a new project. You can use the menu: Project – Target Build Configuration to set “absolute OMF file name” more appropriately. It is not necessary to do that, but it is good to know what is going on. EE/CS-352: Embedded Microcontroller Systems
Reset • Three ways to reset the processor: • When unconnected, press the reset button on the board. • When connected, press the RESET button on the IDE. • Watchdog timer overflow. On reset, program execution starts here. EE/CS-352: Embedded Microcontroller Systems
What Happens at Reset? • CPU halts operation • SFRs are initialized to default values • External pins set to a known state • Interrupts and Timers turned off • System clock defaults to 2MHz internal clock • PC reset • Watchdog timer set with longest timeout period EE/CS-352: Embedded Microcontroller Systems
Ways of specifying HEX numbers in assembler code 0x prefix Example: 0xF4 h suffix Example: 33h EE/CS-352: Embedded Microcontroller Systems
Watchdog Timer • 21-bit timer runs off system clock (intially 2MHz) • Overflow of timer causes reset • Software must either disable watchdog timer, or periodically reset the timer so that it does not overflow • Timer can be “locked” to prevent disabling EE/CS-352: Embedded Microcontroller Systems
More details of the Assembly process The following code is produced in code memory by the assembler: cseg at 0 mov a, #0 mov 0x30, a mov DPTR, #0x445a nop Pages 103-105 give the number of bytes per 8051 instruction for the C8051F020. EE/CS-352: Embedded Microcontroller Systems