Hi, I'm new here. I'm italian and so my english is not very good...pardon!
I have need to program MSP430F2121 (28 pin, 4KB, UART) using BSL (Bootstrap Loader) controlled by PC. By Visual Basic 6, I'm be able to driver RS232 (TX, RX, RTS, and DTR) and I'm be able to communicate to MSP430F2121.
I make thing step-by-step, reading before sall0089d and slaa0096d.
First Step: I send to MSP SYNC (0x80) command, and I receive ACK (0x90). It's all right!
Second Step: After SYNC command, I send MASS ERASE command: HDR: 0x80 CMD: 0x18 L1: 0x04 L2. 0x04 AL: 0x00 AH: 0xFF LL: 0x06 LH: 0xA5 CKL: 0x7D CKH: 0xB9 The parameters AH, AH, LL, LH are suggested by TI (see the example of Visual C++ application for Win32) MSP430 answers me by ACK, 0x90 and in effect all memory is empty, all0xFF But there's a mistery: if I send RX PASSWORD, MSP430 answers me NAK, 0xA0 after the fourth byte and voltage level goes low by MSP430: WHY???
Thirth Step: After SYNC Command, I send RX PASSOWRD, in other words, I send to MSP430 the password, that is 32 times 0xFF after MASS ERASE. Now MSP430 answers me ACK, 0x90. It's all right! But some times, MSP430 answers me NAK, 0xA0 after the fourth byte and voltage level goes low by MSP430: WHY??? In MSP430F2121, as other new chips, when password is wrong, MSP430 erase all flash memory, filled with 0xFF. When MSP430 answers me by ACK, I verify, reading the flash memory, that RX PASSWORD command is processed right.
Fourth Step: After SYNC command and after RX PASSWORD, I try to write 2 bytes (always even data, because MSP430 is a 16 bit MCU!!) in flash memory, but MSP430 answers me NAK, 0xA0, ALWAYS!!! The string that I sent is: HDR: 0x80 CMD: 0x12 L1: 0x06 L2. 0x06 AL: 0x00 AH: 0xF8 LL: 0x02 LH: 0x00 D1: 0x12 D2: 0x34 CKL: 0x69 CKH: 0x27 Seeing in details: L1=L2 and indicate that the bytes are 6 (AL, AH, LL, LH, D1, D2) AL, AH indicate the start address memory using little-endian notation:0xF800 LL, LH indicate the number of pure data bytes: only 2, D1 and D2 D1 and D2 indicate the data that I want to write into flash memory CKL, CKH indicate the cheacksum calculated by: CKL=HDR xor L1 xor AL xor LL xor D1 xor 0xFF CKH=CMD xor L2 xor AH xor LH xor D2 xor 0xFF Why I add "xor 0xFF"? Because I must inverted the subtotal xor calculation: CKL=INVERTE (HDR xor L1 xor AL xor LL xor D1). It's the same! But I receive from MSP430, NAK: WHY????
Could someone help me, please? Federico