This is the Device code of PIC18F46J50: i've used SystemConvert software, you can find here
Code: Select all
{
****************************************************************
* Name : 18F46J50 *
* Author : David John Barker *
* Notice : Copyright (c) 2011 Mecanique *
* : All Rights Reserved *
* Date : 10/01/2011 *
****************************************************************
}
module SystemTypes
// system header...
#const _core = $0012 // processor core
#const _ram_banks = $0F // 15 RAM bank(s) used
#variable _maxaccess = $60 // access ram is 96 bytes
#variable _maxram = $0E80 // 3712 bytes of user RAM
#variable _maxrom = $00FFF8 // 63 KB of program ROM
#const _eeprom = $0000 // 0 bytes of EEPROM
#const _eeprom_start = $F00000 // EEPROM start address
#const _ports = $05 // 5 available ports
#const _ccp = $00 // CCP module NOT supported
#const _eccp = $02 // 2 ECCP module(s) available
#const _mssp = $02 // 2 MSSP module(s) available
#const _usart = $02 // 2 USART(s) available
#const _adc = $0D // 13 ADC channels available
#const _adres = $0A // 10 bit ADC resolution
#const _comparator = $00 // comparator module NOT supported
#const _psp = $00 // Parallel Slave Port (PSP) is NOT supported
#const _can = $00 // onboard CAN is NOT supported
#const _usb = $01 // onboard USB available
#const _ethernet = $00 // onboard Ethernet is NOT supported
#const _flash_write = $01 // FLASH has write capability
// special function registers...
public system
RPOR0 as byte absolute $0EC6,
RPOR1 as byte absolute $0EC7,
RPOR2 as byte absolute $0EC8,
RPOR3 as byte absolute $0EC9,
RPOR4 as byte absolute $0ECA,
RPOR5 as byte absolute $0ECB,
RPOR6 as byte absolute $0ECC,
RPOR7 as byte absolute $0ECD,
RPOR8 as byte absolute $0ECE,
RPOR9 as byte absolute $0ECF,
RPOR10 as byte absolute $0ED0,
RPOR11 as byte absolute $0ED1,
RPOR12 as byte absolute $0ED2,
RPOR13 as byte absolute $0ED3,
RPOR17 as byte absolute $0ED7,
RPOR18 as byte absolute $0ED8,
RPOR19 as byte absolute $0ED9,
RPOR20 as byte absolute $0EDA,
RPOR21 as byte absolute $0EDB,
RPOR22 as byte absolute $0EDC,
RPOR23 as byte absolute $0EDD,
RPOR24 as byte absolute $0EDE,
RPINR1 as byte absolute $0EE7,
RPINR2 as byte absolute $0EE8,
RPINR3 as byte absolute $0EE9,
RPINR4 as byte absolute $0EEA,
RPINR6 as byte absolute $0EEC,
RPINR7 as byte absolute $0EED,
RPINR8 as byte absolute $0EEE,
RPINR12 as byte absolute $0EF2,
RPINR13 as byte absolute $0EF3,
RPINR16 as byte absolute $0EF6,
RPINR17 as byte absolute $0EF7,
RPINR21 as byte absolute $0EFB,
RPINR22 as byte absolute $0EFC,
RPINR23 as byte absolute $0EFD,
RPINR24 as byte absolute $0EFE,
PPSCON as byte absolute $0EFF,
UEP0 as byte absolute $0F26,
UEP1 as byte absolute $0F27,
UEP2 as byte absolute $0F28,
UEP3 as byte absolute $0F29,
UEP4 as byte absolute $0F2A,
UEP5 as byte absolute $0F2B,
UEP6 as byte absolute $0F2C,
UEP7 as byte absolute $0F2D,
UEP8 as byte absolute $0F2E,
UEP9 as byte absolute $0F2F,
UEP10 as byte absolute $0F30,
UEP11 as byte absolute $0F31,
UEP12 as byte absolute $0F32,
UEP13 as byte absolute $0F33,
UEP14 as byte absolute $0F34,
UEP15 as byte absolute $0F35,
UIE as byte absolute $0F36,
UEIE as byte absolute $0F37,
UADDR as byte absolute $0F38,
UCFG as byte absolute $0F39,
PADCFG1 as byte absolute $0F3C,
REFOCON as byte absolute $0F3D,
RTCCAL as byte absolute $0F3E,
RTCCFG as byte absolute $0F3F,
ODCON3 as byte absolute $0F40,
ODCON2 as byte absolute $0F41,
ODCON1 as byte absolute $0F42,
ANCON0 as byte absolute $0F48,
ANCON1 as byte absolute $0F49,
DSWAKEL as byte absolute $0F4A,
DSWAKEH as byte absolute $0F4B,
DSCONL as byte absolute $0F4C,
DSCONH as byte absolute $0F4D,
DSGPR0 as byte absolute $0F4E,
DSGPR1 as byte absolute $0F4F,
TCLKCON as byte absolute $0F52,
CVRCON as byte absolute $0F53,
PMSTATL as byte absolute $0F54,
PMSTATH as byte absolute $0F55,
PMEL as byte absolute $0F56,
PMEH as byte absolute $0F57,
PMDIN2L as byte absolute $0F58,
PMDIN2H as byte absolute $0F59,
PMDOUT2L as byte absolute $0F5A,
PMDOUT2H as byte absolute $0F5B,
PMMODEL as byte absolute $0F5C,
PMMODEH as byte absolute $0F5D,
PMCONL as byte absolute $0F5E,
PMCONH as byte absolute $0F5F,
UFRM as byte absolute $0F60,
UFRML as byte absolute $0F60,
UFRMH as byte absolute $0F61,
UIR as byte absolute $0F62,
UEIR as byte absolute $0F63,
USTAT as byte absolute $0F64,
UCON as byte absolute $0F65,
DMABCH as byte absolute $0F66,
DMABCL as byte absolute $0F67,
RXADDRH as byte absolute $0F68,
RXADDRL as byte absolute $0F69,
TXADDRH as byte absolute $0F6A,
TXADDRL as byte absolute $0F6B,
PMDIN1L as byte absolute $0F6C,
PMDIN1H as byte absolute $0F6D,
PMADDRL as byte absolute $0F6E,
PMDOUT1L as byte absolute $0F6E,
PMADDRH as byte absolute $0F6F,
PMDOUT1H as byte absolute $0F6F,
CMSTAT as byte absolute $0F70,
CMSTATUS as byte absolute $0F70,
SSP2CON2 as byte absolute $0F71,
SSP2CON1 as byte absolute $0F72,
SSP2STAT as byte absolute $0F73,
SSP2ADD as byte absolute $0F74,
SSP2BUF as byte absolute $0F75,
T4CON as byte absolute $0F76,
PR4 as byte absolute $0F77,
TMR4 as byte absolute $0F78,
T3CON as byte absolute $0F79,
TMR3L as byte absolute $0F7A,
TMR3H as byte absolute $0F7B,
BAUDCON2 as byte absolute $0F7C,
SPBRGH2 as byte absolute $0F7D,
BAUDCON as byte absolute $0F7E,
BAUDCON1 as byte absolute $0F7E,
BAUDCTL as byte absolute $0F7E,
SPBRGH as byte absolute $0F7F,
SPBRGH1 as byte absolute $0F7F,
HLVDCON as byte absolute $0F85,
DMACON2 as byte absolute $0F86,
DMACON1 as byte absolute $0F88,
LATA as byte absolute $0F89,
LATB as byte absolute $0F8A,
LATC as byte absolute $0F8B,
LATD as byte absolute $0F8C,
LATE as byte absolute $0F8D,
ALRMVALL as byte absolute $0F8E,
ALRMVALH as byte absolute $0F8F,
ALRMRPT as byte absolute $0F90,
ALRMCFG as byte absolute $0F91,
TRISA as byte absolute $0F92,
TRISB as byte absolute $0F93,
TRISC as byte absolute $0F94,
TRISD as byte absolute $0F95,
TRISE as byte absolute $0F96,
T3GCON as byte absolute $0F97,
RTCVALL as byte absolute $0F98,
RTCVALH as byte absolute $0F99,
T1GCON as byte absolute $0F9A,
OSCTUNE as byte absolute $0F9B,
RCSTA2 as byte absolute $0F9C,
PIE1 as byte absolute $0F9D,
PIR1 as byte absolute $0F9E,
IPR1 as byte absolute $0F9F,
PIE2 as byte absolute $0FA0,
PIR2 as byte absolute $0FA1,
IPR2 as byte absolute $0FA2,
PIE3 as byte absolute $0FA3,
PIR3 as byte absolute $0FA4,
IPR3 as byte absolute $0FA5,
EECON1 as byte absolute $0FA6,
EECON2 as byte absolute $0FA7,
TXSTA2 as byte absolute $0FA8,
TXREG2 as byte absolute $0FA9,
RCREG2 as byte absolute $0FAA,
SPBRG2 as byte absolute $0FAB,
RCSTA as byte absolute $0FAC,
RCSTA1 as byte absolute $0FAC,
TXSTA as byte absolute $0FAD,
TXSTA1 as byte absolute $0FAD,
TXREG as byte absolute $0FAE,
TXREG1 as byte absolute $0FAE,
RCREG as byte absolute $0FAF,
RCREG1 as byte absolute $0FAF,
SPBRG as byte absolute $0FB0,
SPBRG1 as byte absolute $0FB0,
CTMUICON as byte absolute $0FB1,
CTMUCONL as byte absolute $0FB2,
CTMUCONH as byte absolute $0FB3,
CCP2CON as byte absolute $0FB4,
ECCP2CON as byte absolute $0FB4,
CCPR2 as byte absolute $0FB5,
CCPR2L as byte absolute $0FB5,
CCPR2H as byte absolute $0FB6,
ECCP2DEL as byte absolute $0FB7,
PWM2CON as byte absolute $0FB7,
ECCP2AS as byte absolute $0FB8,
PSTR2CON as byte absolute $0FB9,
CCP1CON as byte absolute $0FBA,
ECCP1CON as byte absolute $0FBA,
CCPR1 as byte absolute $0FBB,
CCPR1L as byte absolute $0FBB,
CCPR1H as byte absolute $0FBC,
ECCP1DEL as byte absolute $0FBD,
PWM1CON as byte absolute $0FBD,
ECCP1AS as byte absolute $0FBE,
PSTR1CON as byte absolute $0FBF,
WDTCON as byte absolute $0FC0,
ADCON1 as byte absolute $0FC1,
ADCON0 as byte absolute $0FC2,
ADRES as byte absolute $0FC3,
ADRESL as byte absolute $0FC3,
ADRESH as byte absolute $0FC4,
SSP1CON2 as byte absolute $0FC5,
SSPCON2 as byte absolute $0FC5,
SSP1CON1 as byte absolute $0FC6,
SSPCON1 as byte absolute $0FC6,
SSP1STAT as byte absolute $0FC7,
SSPSTAT as byte absolute $0FC7,
SSP1ADD as byte absolute $0FC8,
SSPADD as byte absolute $0FC8,
SSP1BUF as byte absolute $0FC9,
SSPBUF as byte absolute $0FC9,
T2CON as byte absolute $0FCA,
PR2 as byte absolute $0FCB,
TMR2 as byte absolute $0FCC,
T1CON as byte absolute $0FCD,
TMR1L as byte absolute $0FCE,
TMR1H as byte absolute $0FCF,
RCON as byte absolute $0FD0,
CM2CON as byte absolute $0FD1,
CM2CON1 as byte absolute $0FD1,
CM1CON as byte absolute $0FD2,
CM1CON1 as byte absolute $0FD2,
OSCCON as byte absolute $0FD3,
T0CON as byte absolute $0FD5,
TMR0L as byte absolute $0FD6,
TMR0H as byte absolute $0FD7,
STATUS as byte absolute $0FD8,
FSR2L as byte absolute $0FD9,
FSR2H as byte absolute $0FDA,
PLUSW2 as byte absolute $0FDB,
PREINC2 as byte absolute $0FDC,
POSTDEC2 as byte absolute $0FDD,
POSTINC2 as byte absolute $0FDE,
INDF2 as byte absolute $0FDF,
BSR as byte absolute $0FE0,
FSR1L as byte absolute $0FE1,
FSR1H as byte absolute $0FE2,
PLUSW1 as byte absolute $0FE3,
PREINC1 as byte absolute $0FE4,
POSTDEC1 as byte absolute $0FE5,
POSTINC1 as byte absolute $0FE6,
INDF1 as byte absolute $0FE7,
WREG as byte absolute $0FE8,
FSR0L as byte absolute $0FE9,
FSR0H as byte absolute $0FEA,
PLUSW0 as byte absolute $0FEB,
PREINC0 as byte absolute $0FEC,
POSTDEC0 as byte absolute $0FED,
POSTINC0 as byte absolute $0FEE,
INDF0 as byte absolute $0FEF,
INTCON3 as byte absolute $0FF0,
INTCON2 as byte absolute $0FF1,
INTCON as byte absolute $0FF2,
PROD as byte absolute $0FF3,
PRODL as byte absolute $0FF3,
PRODH as byte absolute $0FF4,
TABLAT as byte absolute $0FF5,
TBLPTR as byte absolute $0FF6,
TBLPTRL as byte absolute $0FF6,
TBLPTRH as byte absolute $0FF7,
TBLPTRU as byte absolute $0FF8,
PC as byte absolute $0FF9,
PCL as byte absolute $0FF9,
PCLATH as byte absolute $0FFA,
PCLATU as byte absolute $0FFB,
STKPTR as byte absolute $0FFC,
TOS as byte absolute $0FFD,
TOSL as byte absolute $0FFD,
TOSH as byte absolute $0FFE,
TOSU as byte absolute $0FFF
// system ports...
public system port
PORTE as byte absolute $0F84,
PORTD as byte absolute $0F83,
PORTC as byte absolute $0F82,
PORTB as byte absolute $0F81,
PORTA as byte absolute $0F80
// alias...
public dim
FSR0 as FSR0L.AsWord,
FSR1 as FSR1L.AsWord,
FSR2 as FSR2L.AsWord,
TABLEPTR as TBLPTRL.AsWord
// configuration fuses...
public config
WDTEN(WDTEN) = [OFF, ON],
PLLDIV(PLLDIV) = [12, 10, 6, 5, 4, 3, 2, 1],
STVREN(STVREN) = [OFF, ON],
XINST(XINST) = [OFF, ON],
CPUDIV(CPUDIV) = [OSC4_PLL6, OSC3_PLL3, OSC2_PLL2, OSC1],
CP0(CP0) = [ON, OFF],
OSC(OSC) = [INTOSC, INTOSCO, INTOSCPLL, INTOSCPLLO, HS, HSPLL, EC, ECPLL],
T1DIG(T1DIG) = [OFF, ON],
LPT1OSC(LPT1OSC) = [ON, OFF],
FCMEN(FCMEN) = [OFF, ON],
IESO(IESO) = [OFF, ON],
WDTPS(WDTPS) = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768],
DSWDTOSC(DSWDTOSC) = [T1OSCREF, INTOSCREF],
RTCOSC(RTCOSC) = [INTOSCREF, T1OSCREF],
DSBOREN(DSBOREN) = [OFF, ON],
DSWDTEN(DSWDTEN) = [OFF, ON],
DSWDTPS(DSWDTPS) = [2, 8, 32, 128, 512, 2048, 8192, K32, K131, K524, M2, M8, M33, M134, M536, G2],
IOL1WAY(IOL1WAY) = [OFF, ON],
MSSP7B_EN(MSSP7B_EN) = [MSK5, MSK7],
WPFP(WPFP) = [PAGE_0, PAGE_1, PAGE_2, PAGE_3, PAGE_4, PAGE_5, PAGE_6, PAGE_7, PAGE_8, PAGE_9, PAGE_10, PAGE_11, PAGE_12, PAGE_13, PAGE_14, PAGE_15, PAGE_16, PAGE_17, PAGE_18, PAGE_19, PAGE_20, PAGE_21, PAGE_22, PAGE_23, PAGE_24, PAGE_25, PAGE_26, PAGE_27, PAGE_28, PAGE_29, PAGE_30, PAGE_31, PAGE_32, PAGE_33, PAGE_34, PAGE_35, PAGE_36, PAGE_37, PAGE_38, PAGE_39, PAGE_40, PAGE_41, PAGE_42, PAGE_43, PAGE_44, PAGE_45, PAGE_46, PAGE_47, PAGE_48, PAGE_49, PAGE_50, PAGE_51, PAGE_52, PAGE_53, PAGE_54, PAGE_55, PAGE_56, PAGE_57, PAGE_58, PAGE_59, PAGE_60, PAGE_61, PAGE_62, PAGE_63],
WRITE(WRITE) = [0],
WPEND(WPEND) = [PAGE_0, PAGE_WPFP],
WPCFG(WPCFG) = [ON, OFF],
WPDIS(WPDIS) = [ON, OFF]
// default fuses...
config
WDTEN = OFF,
STVREN = ON,
XINST = OFF,
OSC = HS,
FCMEN = OFF,
IESO = OFF,
WDTPS = 128