реклама на сайте
подробности

 
 
> отладка LPC2366. IAR, mac файл.
meister
сообщение Apr 15 2008, 07:58
Сообщение #1


Местный
***

Группа: Участник
Сообщений: 219
Регистрация: 20-11-07
Пользователь №: 32 484



Поделитесь пожалуйста рабочим mac файлом, чтобы отлаживать LPC2366 на IAR 4.42 smile.gif

Спасибо.

С тем, что был в комплекте в IAR 4.42A не шилось в отладчике вообще. Местами поправил (чтоб ширина зиписываемых регистров соответствовала мануалу). Один раз с горем пополам прошилось.

Сейчас мой выглядит вот так:

Код
execUserFlashInit()
{
    // Disable the PLL.
    __writeMemory8(0x00000000, 0xE01FC080, "Memory"); // PLLCON = 0
    // Qualify the PLL change.
    __writeMemory8(0x000000AA, 0xE01FC08C, "Memory"); // PLLFEED = 0xAA
    __writeMemory8(0x00000055, 0xE01FC08C, "Memory"); // PLLFEED = 0x55

    // Enable main clock (LPC23xx only).
    __writeMemory32(0x00000020, 0xE01FC1A0, "Memory"); // SCS.OSCEN = 1
    
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)


    // Switch to main clock instead of internal RC for stable JTAG auto-speed (LPC23xx only).
    __writeMemory8(0x00000001, 0xE01FC10C, "Memory"); // CLKSRCSEL = 1

    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)


    // Make sure that the flash memory system is correctly setup.
    __writeMemory8(0x00000000, 0xE01FC000, "Memory"); // MAMCR = 0

    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)

    __writeMemory8(0x00000007, 0xE01FC004, "Memory"); // MAMTIM = 7

    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)

    __writeMemory8(0x00000002, 0xE01FC000, "Memory"); // MAMCR = 2

    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)
    __sleep(50000); // Give the oscillator some startup time (50 ms)


    // If the MAM values was wrong, a dummy read is necessary to get the flash memory in sync.
    __writeMemory8(0x00000001, 0xE01FC040, "Memory"); // MEMMAP = 1
    __readMemory32(0x00000000, "Memory");
}
Go to the top of the page
 
+Quote Post

Сообщений в этой теме


Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 22nd July 2025 - 00:51
Рейтинг@Mail.ru


Страница сгенерированна за 0.01391 секунд с 7
ELECTRONIX ©2004-2016