Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] Problem that programming pic18f66j60 with mikroC

Status
Not open for further replies.

cllunlu

Member level 4
Joined
Nov 21, 2006
Messages
76
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,900
Hi Friends,

I am trying to programming pic18f66j60. I have problem that when I wrote blinky example, this run but not properly.

my code is

Code:
void main() 
{
     TRISE = 0x00;
     PORTE = 0x00;

    while(1)
     {
          LATE.B2=~LATE.B2;
          LATE.B3=~LATE.B3;
          Delay_us(500);
     }
}

My Project settings: my_project_settings.jpg

For example;
LATE.B2= ~LATE.B2;
Delay_ms(500);

When I run it with above codes, led blinky in 500 second, not 500 milisecond.
when I have noticed that, I changed Delay_us(500) instead of Delay_ms(500). That was true.

As a result, I dont know how to solve this problem. I think osillator settings may be wrong.

Anyone help me?
 

Hi,

If you want 500ms, then use "delay_ms (500)".

Afaik the projects settings are for the compiler only.
But they have to meet with the connected hardware.


Klaus
 

I dont understand your message properly.

Thanks
 

Hi,

If you want 500ms, then use "delay_ms (500)".
You wrote "Delay_us(500);" --> write "delay_ms (500);" instead

Afaik the projects settings are for the compiler only.
But they have to meet with the connected hardware.
You write 25.000MHz, and configured a HS oscillator, but what is the real hardware?

Can you show us your actual schematic?

Are all the power supplies correct and is all necessary hardware connected, like power supply capacitors, RESET circuit...

Klaus
 

In addition, at the screenshot above there is configured a value for the watchdog timer. I'm not familiar with this IDE, but you should check if this implies on activating it.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top