Buy Contact NSDSP Home

mcu_hex_factor

This function returns Hex factor - a ratio between Hex addresses and device addresses.

Syntax

int mcu_hex_factor(
        mcu_t             mcu
);

Parameters

mcu - a reference to the MCU object returned by mcu_create or mcu_get_slave_core function.

Return

The function returns the Hex factor for the MCU.

Notes

Some of the target devices have oddly sized instructions. For such target devices the addresses in the HEX file are different from device addresses. To convert device addresses to HEX addresses, you need to multiply by the Hex factor.

PIC12 and PIC16 - instruction size is 12 or 14 bits. Hence the instruction needs 2 bytes to store, but occupies only 1 byte in the device address space. Hex factor is 2.

PIC24, dsPIC30, dsPIC33 - instruction size is 24 bits. Hence the instruction needs 4 bytes to store, but occupies 2 bytes in the device address space. Hex factor is 2.

others - HEX factor is 1.

 

Minimum library version - 163

Northern Software Home NSDSP Contact Us Purchase/View Cart

© 2007-2025 Northern Software Inc. All Rights Reserved.