Jump to content
ELFORUM - Forumul electronistilor
Sign in to follow this  
Guest elenaelena

cum sa configurez porturile A si E ca intrari digitale?

Recommended Posts

Guest elenaelena

Va rog sa ma ajutati cu o initializare a porturilor A si E astfel incat pentru 5 V sa detecteze 1 logic si pentru 0 V sa detecteze 0 logic. Ca mediu de programare folosesc MikroC. Mii de multumiri :)

Share this post


Link to post
Share on other sites

Guest elenaelena

am uitat sa precizez ce era mai important: ca lucrez cu un PIC 16f877

Share this post


Link to post
Share on other sites

Cred ca este important de precizat daca este F877 sau F877A. Am sa presupun ca este 877A, ptr ca cele fara A nu se mai fabrica.Inteleg ca vrei sa le configurezi ca intrari.Ptr portul A:TRISA=0xCF ;toate bufferele sunt intrariADCON1=0x06 ;Portul A este digital, nu analogicCMCON=0x07 ;Portul A este digitalDetalii in foaia de catalog la capitolul 4.1Ptr portul E:TRISE=0x03 ;toate buferele sunt intrariADCON1=0x06 ;Portul E este digital, nu analogicSper ca nu mi-a scapat nimic. :)Daca tot nu merge, posteaza aici cum configurezi si ce nu face.Cirip

Share this post


Link to post
Share on other sites
Guest elenaelena

ms mult cirip, a mers perfect ce mi-ai recomandat tu, insa fara sa fetez registrul CMCON :)

Share this post


Link to post
Share on other sites
Guest elenaelena

pana la urma configurarea corecta este: pentru portul A: TRISA=0x3F;ADCON1=0x06;pentru portul E: TRISE=0x07;ADCON1=0x06;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines