PDA

View Full Version : 12f1572



Rony
- 28th January 2017, 13:41
Hi everyone,

I got the PIC12F1572 and compile it with the PBP3.0.4.0
It runs properly when using INTRC, but with external oscillator it doesn't...
Although i set necessary configuration (ECH, Clock out pin ...) but still not working.
Note that i am just blinking an LED in the test.


DEFINE OSC 20
PORTA = %00000000
TRISA = %00001000
INTCON = %00000000
PIR1 = %00000000
PIE1 = %00000000
OPTION_REG = %00000000
T1CON = %00000000
T2CON = %00000000
WPUA = %00001000
ADCON0 = %00000000
ADCON1 = %00000000
ADCON2 = %00000000
ANSELA = %00000000
CM1CON0 = %00000000
CM1CON1 = %00000000
ODCONA = %00000000
PWM1CON = %00000000
PWM2CON = %00000000
PWM3CON = %00000000
DACCON0 = %00000000
DACCON1 = %00000000
CWG1CON0 = %00000000
CWG1CON1 = %00000000
CWG1CON2 = %00000000
CWG1DBF = %00000000
CWG1DBR = %00000000

clear

Main:

PORTA.2= 1
pause 100
PORTA.2 = 0
pause 900

goto Main



Does anyone can help ?

Thanks
Rony

HenrikOlsson
- 28th January 2017, 13:53
It runs properly when using INTRC, but with external oscillator it doesn't...
Although i set necessary configuration (ECH, Clock out pin ...) but still not working.
Well, show us the necessary configuration then and tell us what type of external oscialltor you're actually using and how it's connected. Without that we can only guess.

/Henrik.

Rony
- 28th January 2017, 14:10
83708371
Attached relative pictures

Rony
- 28th January 2017, 14:11
sorry i forget the resonator
I will put it now

Rony
- 28th January 2017, 14:15
Resonator added to the schematic
8373

HenrikOlsson
- 28th January 2017, 14:20
OK, with a resonator I don't think you can have CLKOUT enabled.

/Henrik.

Rony
- 28th January 2017, 14:25
The other option is I/O function which is not the case, anyway i just tested it and didn't function.

8374

HenrikOlsson
- 28th January 2017, 15:15
You're right, it can't be I/O -but it can't be CLKOUT either....
I may be wrong but it looks to me as if the 12F1572 can not run directly on a crystal or resonator but rather depends on an external oscillator "module". I suggest you read the oscillator section of the datasheet and see if you agree.

/Henrik.

Rony
- 28th January 2017, 16:27
I think you're right, i was reading it now and found out that this PIC is not suitable for oscillator or resonator, it should be used by either internal clock or external clock.
Thanks for your cooperation.