what's the startup clock frequency of PIC1703

I'd like to run from internal osc (XTAL pins as GPIO), but from the configuration bits it looks like it defaults to ext clk. I can't seem to find docs on their two speed startup and Fail-safe clock monitor thingy. Also, will LVP work?

Reply to
Johann Klammer
Loading thread data ...

Reply to
Johann Klammer

You mean the PIC16F1703 right.

data sheet here

formatting link

Please read page 48 - 52 for the non-volatile device configuration settings. On reset the mcu reads these settings and configures the mcu for execution of the program.

Bits FOSC: tell the 1703 which Osc to use

Please read page 62 onward regarding setting the Oscillator and fail safe

Reply to
jjoey.gold

You may also care to use MPLAB X IDE and Plug-In MCC to gernerate code to control these registers

formatting link

Reply to
jjoey.gold

I was wondering if it was actually possible to set those registers without an external clock present, as the factory defaults seem to indicate external clock.

Reply to
Johann Klammer

The default doesn't matter. If you want the internal oscillator, set the relevant configuration fuses accordingly in your code.

That appears to be an error in the data sheet. I can't see any evidence that this PIC has those features. You'd need to contact Microchip to be sure.

Do you have a reason to think it wouldn't work?

Reply to
John Temples

It requires a working clock, no? Without one, how do you enter LVP to set the FOSC fuse?

Reply to
Johann Klammer

The programmer (ICD3, etc.) provides a clock on the PGC line when programming the device. The CPU doesn't run its own clock.

Reply to
John Temples

On Wednesday, 8 August 2018 16:33:23 UTC+10, John Temples wrote:

In your C code or header file you include #PARAM xxx setting

16F1703 Support Information #pragma config Usage #pragma config = For example: // Oscillator Selection Bits: External oscillator, high power. I/O function on RA4 // Watchdog Timer Enable: WDT enabled // Power-up Timer Enable: PWRT disabled // MCLR Pin Function Select: MCLR/VPP pin function is MCLR // Flash Program Memory Code Protection: Program memory code protection is disabled // Brown-out Reset Enable: Brown-out Reset enabled // Clock Out Enable: CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin #pragma config FOSC = ECH, WDTE = ON, PWRTE = OFF, MCLRE = ON, CP = OFF, BOREN = ON, CLKOUTEN = OFF #pragma config = For example: // Oscillator Selection Bits: External oscillator, high power. I/O function on RA4 // Watchdog Timer Enable: WDT enabled // Power-up Timer Enable: PWRT disabled // MCLR Pin Function Select: MCLR/VPP pin function is MCLR // Flash Program Memory Code Protection: Program memory code protection is disabled // Brown-out Reset Enable: Brown-out Reset enabled // Clock Out Enable: CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin #pragma config FOSC = 0x3, WDTE = 0x3, PWRTE = 0x1, MCLRE = 0x1, CP = 0x1, BOREN = 0x3, CLKOUTEN = 0x1 #pragma config = For example: // Oscillator Selection Bits: External oscillator, high power. I/O function on RA4 // Watchdog Timer Enable: WDT enabled // Power-up Timer Enable: PWRT disabled // MCLR Pin Function Select: MCLR/VPP pin function is MCLR // Flash Program Memory Code Protection: Program memory code protection is disabled // Brown-out Reset Enable: Brown-out Reset enabled // Clock Out Enable: CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin #pragma config CONFIG1 = 0xFFFF

For example: // IDLOC @ 0x8000 #pragma config IDLOC0 = 0x3FFF

Back to top #pragma config Settings Register: CONFIG1 @ 0x8007 FOSC = Oscillator Selection Bits ECH External oscillator, high power. I/O function on RA4 ECM External oscillator, medium power. I/O function on RA4 ECL External oscillator, low power. I/O function on RA4 INTOSC Internal HFINTOSC. I/O function on RA4 and RA5. WDTE = Watchdog Timer Enable ON WDT enabled NSLEEP WDT enabled while running and disabled in Sleep SWDTEN WDT controlled by the SWDTEN bit in the WDTCON register OFF WDT disabled PWRTE = Power-up Timer Enable OFF PWRT disabled ON PWRT enabled MCLRE = MCLR Pin Function Select ON MCLR/VPP pin function is MCLR OFF MCLR/VPP pin function is digital input CP = Flash Program Memory Code Protection OFF Program memory code protection is disabled ON Program memory code protection is enabled BOREN = Brown-out Reset Enable ON Brown-out Reset enabled NSLEEP Brown-out Reset enabled while running and disabled in Sleep SBODEN Brown-out Reset controlled by the SBOREN bit in the BORCON register OFF Brown-out Reset disabled CLKOUTEN = Clock Out Enable OFF CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin ON CLKOUT function is enabled on the CLKOUT pin Register: CONFIG2 @ 0x8008 WRT = Flash Memory Self-Write Protection OFF Write protection off BOOT 000h to 1FFh write protected, 200h to 1FFFh may be modified by EECON control HALF 000h to FFFh write protected, 1000h to 1FFFh may be modified by EECON control ALL 000h to 1FFFh write protected, no addresses may be modified by EECON control PPS1WAY = Peripheral Pin Select one-way control ON The PPSLOCK bit cannot be cleared once it is set by software OFF The PPSLOCK bit can be set and cleared repeatedly by software ZCDDIS = Zero-cross detect disable ON Zero-cross detect circuit is disabled at POR OFF Zero-cross detect circuit is enabled at POR PLLEN = Phase Lock Loop enable ON 4x PLL is always enabled OFF 4x PLL is enabled when software sets the SPLLEN bit STVREN = Stack Overflow/Underflow Reset Enable ON Stack Overflow or Underflow will cause a Reset OFF Stack Overflow or Underflow will not cause a Reset BORV = Brown-out Reset Voltage Selection LO Brown-out Reset Voltage (Vbor), low trip point selected. HI Brown-out Reset Voltage (Vbor), high trip point selected. LPBOR = Low-Power Brown Out Reset OFF Low-Power BOR is disabled ON Low-Power BOR is enabled LVP = Low-Voltage Programming Enable ON Low-voltage programming enabled OFF High-voltage on MCLR/VPP must be used for programming

Register: IDLOC0 @ 0x8000 Register: IDLOC1 @ 0x8001 Register: IDLOC2 @ 0x8002 Register: IDLOC3 @ 0x8003 Back to top Back to top

Looking at the XC8 'C' compiler docs for the PIC16F1703

Reply to
jjoey.gold

Ah thanks. all good then. My worry was mainly about running into chicken and egg problems.

Reply to
Johann Klammer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.