2 Memory Usage for PIC16F

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

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

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

(-Os / -O0)

Program Memory (Bytes)Data Memory (Bytes)
1.SW_CPU_REGISTER_RESET_STATE_CHECK_011.0.3 N/A-Os1445
-O02037
2.SW_CPU_REGISTER_TEST_012.0.2 N/A-Os2856
-O04108
3.SW_CPU_SELF_TEST_LIB_011.0.1All Subsets-Os54916
All Subsets-O066421
Subset 1-Os34714
Subset 1-O043919
Subset 2-Os20410
Subset 2-O025515
Subset 3-Os24810
Subset 3-O030215
4.SW_FLASH_MEMORY_CHECKSUM_CRC_TEST_012.0.2CRC16 Direct-Os870112
CRC16 Direct-O01118114
CRC16 Lookup-Os1377112
CRC16 Lookup-O01620114
CRC32 Direct-Os1013116
CRC32 Direct-O01309120
CRC32 Lookup-Os2014116
CRC32 Lookup-O02293120
5.SW_EEPROM_MEMORY_CHECKSUM_CRC_TEST_012.0.1CRC16 Direct-Os56437
CRC16 Direct-O071639
CRC16 Lookup-Os106843
CRC16 Lookup-O0121345
CRC32 Direct-Os73357
CRC32 Direct-O097859
CRC32 Lookup-Os174260
CRC32 Lookup-O0196760
6.SW_SRAM_MARCH_TEST_013.0.2 N/A-Os867117
-O01 N/A1 N/A
7.SW_WATCHDOG_SIMPLE_TIMER_STARTUP_TEST_012.1.0 N/A-Os24011
-O031214
8.SW_WATCHDOG_WINDOWED_TIMER_STARTUP_TEST_012.0.1 N/A-Os33915
-O048919
9.SW_CLOCK_PERIODIC_MONITOR_012.1.0 N/A-Os58868
-O075671
10.SW_CLOCK_PERIODIC_MONITOR_022.0.1 N/A-Os579112
-O0813120
11.SW_INTERRUPT_FREQUENCY_TEST_012.0.1 N/A-Os56455
-O077159

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'.