How lcgamboa/picsim works
PICsim is a C library and standalone simulator for PIC microcontrollers. Its principal workflow is to select/configure a supported device, load firmware, execute instructions while advancing family-specific peripherals, and expose simulated pins and serial communication to a host. The graph preserves the documented hardware capabilities and separates core execution, device models, peripherals, and external I/O. Many peripheral modules are indexed but not excerpted, so their internal call wiring is not asserted.
Main entry points: periferic18.c PIC18 peripherals · picsim.h PIC state and API · periferic16.c PIC16 peripherals · serial.c USART emulation
Components 20
Simulation core
- PIC execution
src/p16fxxx.c - Enhanced execution
src/p16fxxxe.c - PIC18 execution
src/p18fxxx.c - PIC state and API
include/picsim.h - HEX firmware
src/hexfile.c
PIC device models
- PIC16 models
src/pics - PIC18 models
src/pics/PIC18F67J94.c
Hardware peripherals
- PIC16 peripherals
src/periferic16.c - Enhanced peripherals
src/periferic16e.c - PIC18 peripherals
src/periferic18.c - ADC conversion
src/p16/p16_adc.c - EEPROM
src/p16/p16_eeprom.c - Timers and watchdog
src/p18/p18_tmr1.c - Interrupt handling
src/p18/p18_interrupt.c - MSSP and CCP
src/p18/p18_mssp.c - Pin routing
src/p16e/p16e_pps_out.c
Host I/O
- USART emulation
src/common/serial.c - Bit-banged UART
src/common/bitbang_uart.c
Other components
- Embedding host
- Serial device
Connections 17
- Embedding host → PIC state and API: uses API
README.md - Embedding host → HEX firmware: loads firmware
README.md - PIC state and API → PIC16 models: selects model
include/picsim.h - PIC state and API → PIC18 models: selects model
include/picsim.h - PIC16 models → PIC execution: configures execution
src/pics/PIC16F18855.c - PIC18 models → PIC18 execution: configures execution
src/pics/PIC18F67J94.c - PIC execution → PIC16 peripherals: advances peripherals
- Enhanced execution → Enhanced peripherals: advances peripherals
- PIC18 execution → PIC18 peripherals: advances peripherals
- PIC16 peripherals → ADC conversion: dispatches
- PIC16 peripherals → EEPROM: dispatches
- PIC18 peripherals → Timers and watchdog: dispatches
- PIC18 peripherals → Interrupt handling: dispatches
- PIC18 peripherals → MSSP and CCP: dispatches
- Enhanced peripherals → Pin routing: dispatches
- USART emulation → Bit-banged UART: sends bytes
src/common/serial.c - USART emulation → Serial device: reads and writes
src/common/serial.c