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.

Timing Lapse in PICs

Status
Not open for further replies.

Vizier87

Active Member
Hi guys,

I've been programming my PICs quite successfully until the communications part (SPI, UART) completely bugged me down.

Then I experimented with the timing of the PIC (with a 20MHz osc) using an oscilloscope and found out something pretty interesting. I set a program to blink an LED at 1 ms interval, and surprisingly the Scope indicated a 2ms interval! When I changed my Oscillator settings in Edit Project to 10 MHz, only then it gives a correct output of 1 ms interval.

I wonder if this is common? Please advise, gurus.

Thanks.
Vizier87
 
Hi guys,

I've been programming my PICs quite successfully until the communications part (SPI, UART) completely bugged me down.

Then I experimented with the timing of the PIC (with a 20MHz osc) using an oscilloscope and found out something pretty interesting. I set a program to blink an LED at 1 ms interval, and surprisingly the Scope indicated a 2ms interval! When I changed my Oscillator settings in Edit Project to 10 MHz, only then it gives a correct output of 1 ms interval.

I wonder if this is common? Please advise, gurus.

Only 'common' in that you either programmed it or set it incorrectly.

If 10MHz runs twice as fast as 20MHz, then it wasn't running at 20MHz - only 5MHz.
 
so how should I set it? The settings are as shown below, please advise:
**broken link removed**

These settings work well for other peripherals, until I worked on the USART/Serial.

Thanks Nigel.
 
Well the thing is, the options in the box are as follows (I've arranged them for the pertinent details):

**broken link removed**

I'm not sure how to turn off PLL here, or the divide... Can you please be a bit more specific?

Thanks.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top