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.

[SOLVED] [Moved] Start up a program in MPlab's c18

Status
Not open for further replies.

zsolt1

Full Member level 6
Full Member level 6
Joined
Aug 11, 2012
Messages
367
Helped
50
Reputation
100
Reaction score
49
Trophy points
1,308
Location
Cluj-Napoca, Romania
www.et.utcluj.ro
Activity points
3,880
Hi,
I started using c18 compiler for PIC18F4455 without boot loader. I simply don't get to light up 2 led's on RD4 & RD5 pins. 4 Mhz oscillator works , i saw that on scope. It seems that main() never happens .
What is the reason? :bang:


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <p18f4455.h>
#include <delays.h>
# pragma**config FOSC=HS,WDT=OFF,MCLRE=ON
char d=0;
 
    void main(void)                                                                             
    {                                                                    
      TRISDbits.TRISD4=0;       //   27 rel
      TRISDbits.TRISD5=0;       //   28 led                                                                       
 
      while(1)                                                                                  
           {                                                                                    
             Delay10KTCYx(100);                                                                 
             d=~d;                                                            
             LATDbits.LATD5=1;     
             LATDbits.LATD4=d;                       
           }                                                                                    
    }

 
Last edited by a moderator:

Re: Start up a program in MPlab's c18

ok, actually oscillator works when MCLR tied to VSS, & not works when tied to VDD by 10K rezistor. Wired .... i put on a second PIC18f4455 cip. Acts the same way . I have never experienced this :bang:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top