We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Is there a way to get a copy of the bootstrap loader code that is initially executed by the C16x controller. This code would be very helpful and instructive, as I'm trying to figure out how to load and execute a second application program after my original application (programmed into flash) is running. Thanks for any help
Have a look at the boot code for the monitor, the file keil\c166\monitor\batch\boot167.a66 for example. This file includes a 32 byte sub-program that the boot strap loader loads then executes. This sub-program continues loading the rest of the code in the file and when that is complete it executes it. For an example of autobaud rate detection take a look at the file inst167.a66 in the same directory. -Walt
Hello, I just took the following code from an old Infineon appnote, no more available on the Internet; I already implemented it into an application, and it behaves exactly as original on chip bootstrap. Hope this helps you Bruno
DISWDT ; disable watchdog timer MOV SP,#0FC00h ; set stackpointer MOV STKUN,#0FC00h ; set stack underflow pointer MOV STKOV,#0FA00h + 6 ; set stack overflow pointer MOV CP,#0FC00h ; set registerbank WaitStartBit: JB P3.11,WaitStartBit ; wait for start bit at RXD0 BSET T6R ; start timer T6 WaitStopBit: JNB P3.11,WaitStopBit ; wait for stop bit at RXD0 BCLR T6R ; stop timer T6 MOV MDL,T6 ; SUB MDL,#36 ; rounding & adjustment MOV R1,#72 ; baudrate = (T6 / 72) - 1 DIVU R1 ; InitSerialPort: MOV S0BG,MDL ; load baudrate generator BSET P3.10 ; initialize TXD0 output BSET DP3.10 ; MOV S0CON,#8001h ; initialize serial port 0: ; 8-bit data, no parity, one stop bit ; receiver not started: single wire option SendAcknowledge: MOV S0TBUF,#0C5H ; send acknowledge byte for baudrate check WaitTransmOver: JNB S0TIR,WaitTransmOver ; wait till end of transmission BCLR S0TIR ; clear transmit interrupt request flag BSET S0REN ; receiver enabled ReceiveData: MOV R0,#0FA40H ; ReceiveLoop: JNB S0RIR,ReceiveLoop ; wait for receive interrupt request MOVB [R0],S0RBUF ; store received byte BCLR S0RIR ; clear receive interrupt request flag CMPI1 R0,#0FA5FH ; all bytes received ? JMPR CC_NE,ReceiveLoop ; if not, continue loop JMPS 0,0FA40H ; yes: jump to RAM routine