Forums

lpc2148 isp double command answer

Started by "jul...@ymail.com" July 23, 2010
Hi,

I am seeing an odd issue while trying to program a lpc2148 in ISP-mode from a lpc2103. Actually I use the UART0 of the lpc2103 with FIFO enabled but without interrupts (doing synchronous reading/writing).
If I send the sync byte '?' to the lpc2148 I get the "Synchronized\r\n" as expected. Then I answer with "Synchronized\r\n". According to the specs I would await to get a "OK\r\n" immediately back, but I get another "Synchronized\r\n" followed by "OK\r\n".
This continues with all further commands. So when I send "12000\r\n" as clock rate I get back "12000\r\n" followed by "OK\r\n".
Even with the raw data it behaves the same.
Has anyone seen an issue like this before? Or might have an idea where it comes from? Could it maybe be a problem with the lpc2103? So the data is not actually coming from lpc2148, but the 2103 has some weird loopback of the written data?

-Julian

An Engineer's Guide to the LPC2100 Series

Ok, answering myself. Reading the specs carefully did help as usual....
LPC2148 has echo mode of ISP command handler enabled by default. Sending a "A 0\r\n" after synchronisation was successfull stops the echo for further data transfer.

--- In l..., "julianscheel@..." wrote:
>
> Hi,
>
> I am seeing an odd issue while trying to program a lpc2148 in ISP-mode from a lpc2103. Actually I use the UART0 of the lpc2103 with FIFO enabled but without interrupts (doing synchronous reading/writing).
> If I send the sync byte '?' to the lpc2148 I get the "Synchronized\r\n" as expected. Then I answer with "Synchronized\r\n". According to the specs I would await to get a "OK\r\n" immediately back, but I get another "Synchronized\r\n" followed by "OK\r\n".
> This continues with all further commands. So when I send "12000\r\n" as clock rate I get back "12000\r\n" followed by "OK\r\n".
> Even with the raw data it behaves the same.
> Has anyone seen an issue like this before? Or might have an idea where it comes from? Could it maybe be a problem with the lpc2103? So the data is not actually coming from lpc2148, but the 2103 has some weird loopback of the written data?
>
> -Julian
>

Hello,

> This continues with all further commands. So when I send "12000\r\n"
> as clock rate I get back "12000\r\n" followed by "OK\r\n".
> Even with the raw data it behaves the same.

The uC echoes the data you sent back to you, then it answers.

Search for "ISP Echo Command" in the user manual of your used chip.

So you can switch it off or deal with the echos characters.

If you need a general example for programming, get the code of lpc21isp
(e.g. from sourceforge) and have a look into the file lpcprog.c

Best regards,

Martin