1 Memory Usage for PIC18F

Program and data memory consumption for the diagnostic modules for PIC18F devices.

This memory usage is captured with the below toolchain versions and device:

  • MPLAB X IDE: v6.20
  • XC8 Compiler: v2.49
  • Device: PIC18F57Q43
No.Module NameModule VersionConfigurationsOptimization Level

(-Os / -O0)

Program Memory (Bytes)Data Memory (Bytes)
1.SW_CPU_REGISTER_RESET_STATE_CHECK_011.1.3 N/A-Os3445
-O070614
2.SW_CPU_REGISTER_TEST_012.0.2 N/A-Os8226
-O0141615
3.SW_CPU_SELF_TEST_LIB_011.0.1All Subsets-Os190020
All Subsets-O0225029
Subset 1-Os103016
Subset 1-O0127227
Subset 2-Os57010
Subset 2-O075227
Subset 3-Os84210
Subset 3-O0102627
4.SW_FLASH_MEMORY_CHECKSUM_CRC_TEST_012.0.1CRC16 Direct-Os1762329
CRC16 Direct-O02714338
CRC16 Lookup-Os2280330
CRC16 Lookup-O03194339
CRC32 Direct-Os2054353
CRC32 Direct-O03080362
CRC32 Lookup-Os3074356
CRC32 Lookup-O04042365
5.SW_EEPROM_MEMORY_CHECKSUM_CRC_TEST_012.0.1CRC16 Direct-Os119445
CRC16 Direct-O0191457
CRC16 Lookup-Os171246
CRC16 Lookup-O0239458
CRC32 Direct-Os153475
CRC32 Direct-O0238687
CRC32 Lookup-Os255278
CRC32 Lookup-O0334890
6.SW_SRAM_MARCH_TEST_013.0.2 N/A-Os1422300
-O01N/A1N/A
7.SW_WATCHDOG_SIMPLE_TIMER_STARTUP_TEST_012.1.0 N/A-Os49012
-O077621
8.SW_WATCHDOG_WINDOWED_TIMER_STARTUP_TEST_012.0.1 N/A-Os66814
-O0102623
9.SW_CLOCK_PERIODIC_MONITOR_012.0.1 N/A-Os118271
-O0162680
10.SW_CLOCK_PERIODIC_MONITOR_022.0.1 N/A-Os1174113
-O01674128
11.SW_INTERRUPT_FREQUENCY_TEST_012.0.1 N/A-Os63424
-O094033
Note: The values in the above table also include the memory consumption for the dependent peripheral drivers and system modules necessary for the expected functionality of each diagnostic module.
  1. SW_SRAM_MARCH_TEST_01 requires the compiler optimization level set to 's'.