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.

Programming the PIC18F4525

Status
Not open for further replies.

loup-garou

New Member
hi everybody,

I started programming the PIC18F4525 (same us PIC18F2525/2620/4620)using C18 compiler in MPLAB (C language),I compiled and simulated some simple codes (LED blinking in portB) , but when I tried to use the PORTA as an input, i got problems with simulation, cause the PORTA pins should be configurated as digitals or analogs, despite many attempts, i wasn't able to put them in digital. :confused:

I used codes that I found in the datasheet :
ADCON1<3:1>=1111 , ADCON1=6 and PCFG<3:0> = 1111


they are ignored by my compiler (syntax error) hence, I still have the problem, how can I figure it out please?


thanks in advance.



Rq: PORTB has aslo AN I/O but I disable it in the Configuration bits menu of MPLAB (those of PORTA aren't there) i solved also the PORTB problem with using LATB insted of PORTB, I know I can use LATA and the simulation will work, but I think I'd better write a code that clearly mention that the Anlog I/O are disabled (Digitals are enabled). take a look at the pin diagrams that I joined-my PIC is the 18F4525
 

Attachments

  • 18F4525-18F452.JPG
    18F4525-18F452.JPG
    164.2 KB · Views: 441
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top