Renesas M16C

From SEGGER Knowledge Base
Jump to navigation Jump to search

The Renesas M16C family is a 16-bit microcontroller family originally developed by Mitsubishi Electric and now being further developed by Renesas Electronics. It is characterized by high ROM code efficiency, good immunity to electromagnetic interference (EMI/EMS), low power consumption and fast processing in real-time applications. The family comprises various series that differ in clock frequency, memory size and peripheral devices.

Flash Banks

Depending on the device, there are different numbers of flashbanks available. The available flashbanks can be observed in U-Flash after selecting the CPU under the "Device info" tab.

UFlash-FlashBanksM16C.jpg

When loading the programming data, U-Flash checks whether flashbanks are available for the specified address ranges. If data is outside the available flashbanks, an error message is displayed.

Connection

A synchronous and an asynchronous interface is available for programming. Both use the CPU's built-in flash loader for programming.

The synchronous interface enables significantly faster programming cycles than the asynchronous interface.

Depending on the adapter used, the Busy pin must be selected accordingly in the setup.

With the asynchronous interface, the best fitting baud rate is determined based on oscillator deviations around the specified baud rate.

Here are the two corresponding wiring schemes for the two available modes:

M16C Sync-Wiring.JPG
M16C Async-Wiring.JPG

ID code

M16C can be ID code protected. If an ID code is activated, the flashloader does not allow any access to the system memory.

The default ID code is 7 times 0xFF. Any ID code must be entered in HEX.

If you do not know the ID code, ALeRASE in HEX can be entered as ID code (see blue box). Please keep in mind that the device is completely erased! An ALeRASE is only possible directly after an POWER_ON cycle.

Please switch to the "Extended view" at the bottom left to get the input field of the ID code.


UFlash-M16C-Password.JPG
  • A chip that was ALeRASED always starts UNLOCKED! till an ID Code is set and a POWER_ON Reset is executed
  • An ALeRASE ONLY works after an POWER_ON Reset! (On an R5F364AMNFB it takes approx. 1.5s)
  • A locked device can be unlocked with ID code after POWER_ON Reset. (You have only up to 3 tries after POWER_ON). After 3 tries also a correct ID code is rejected and the device has to be power cycled again.
  • The last flash page contains the password. If the last page is flashed, the password may be changed based on the content of the data file. It becomes active after the next Power On reset.

Troubleshooting

In case of trouble please increase the "Verbosity level" to get more information about what is going wrong. You find this entry in U_Flash under "Configure project" "Analysis".

Type #AUTO or #START in the U-Flash console window and note the messages. Wiring errors, selecting the wrong Busypin and password are often the cause of login problems.