Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC18F452 and trouble with clk generation.

Status
Not open for further replies.

aniketrane

New Member
Sorry to interrupt, but I am also working with PIC18F452 and I am also facing problems with my oscillator. I am using 20 MHz crystal with pair of 33 pF capacitors. I am using PICSTART PLUS programmer by microchip (Firmware updated to V 3.11) and MPLAB IDE 6.3. I have configured my PIC as following:
>Oscillator configuration: EC with osc2 pin as output.
>Watchdog Timer: disabled
>Power up timer: disabled
>brown out detect: disabled
>low voltage programming: enabled
>code protect: disabled
>table read / write protect: disabled

The circuit i am using to generate clock is shown in the diagram

So as a result I should get clk-out on pin 14 (osc2 pin). But I am not getting it. Also I am setting the pins of port B alternately high and low to drive some LEDS, but I am getting no output on the pins (0 – 0.5 V).
The code that I am trying to execute is:

LIST P=PIC18F452
include "P18F452.INC"

org 0000
goto start

start:
CLRF STATUS
CLRF PORTB
CLRF LATB
MOVLW 0x00
MOVWF TRISB
MOVLW 0xAA
MOVWF PORTB
END


I would like to know where I am going wrong.
**broken link removed**
 

Attachments

  • clk_ckt.jpg
    clk_ckt.jpg
    12.5 KB · Views: 638
Clock Generation

When I got the 18f452 to work in my embedded project, I did not use any of the external circuitry you have shown. Across the OSC1/OSC2 pins I placed my 20 mhz crystal. Then I ran 22 pf caps to ground on each of those legs. Configure the PIC for HS ( high speed external crystal) and your code might work. Good luck.

Nate
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top