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.

How can i use PORTA PIN6 (RA6) in PIC18F452

Status
Not open for further replies.

Ahmed Adel

New Member
Hello everyone,,

I am trying to learn how to program a micro-controller and i succeeded till now to learn through the internet but i still have a problem,, am a bit confused on how to use PIN 6 in port A.. i knew that ports A could be digital or analog,, so i chose digital but i want to use the 7 BIT PORTA but i found that RA6 is multiplexed with the OSC,, and am using a 20MHZ OSC,, Does anyone know how to solve that problem ,, or do i have to use an internal OSC to use pin6 ?? if the answer was yes ,, does the PIC16f877 good to be used ??

well something else,, i read in the datasheet that the pic can write/erase 100,000 times. so is that write or not?? because i bought it from 3 weeks and i erased and burned like 30 or 40 times,, maybe more and now when i try to erase it's not erased and i can't program anymore programs but the chip is working only with the old code. i also checked on another burner and i couldnt erase and checked to set if there was any code protection and my friend how tested it told me that there was a protection although i set to fuze to NOPROTECT but he removed it but couldnt also erase the chip. so how can i solve that issue ?

thanks in advance
 
The pin can be either an I/O pin or the oscillator pin, not both. If you must use an internal oscillator then I would suggest switching to the 18F4520 as this is the modern replacement.

The not being able to erase the chip shouldn't happen and it is more likely to be your programmer than the chip. Which programmer are you using.

Mike.
 
thank for your reply. well i am using the CCS compiling and i am burning on the chip using DIY K128 v141204 MicorPro as it's written like this in the title when i open the program. but i mentioned that i tried to erase the chip using another burner but i don't remember the name and me and me friend using the other program showed that there was code protection although i didnt chose to protect my code but he removed it and tried to erase but it didn't. By the way to be more clear, when i erase the chip using the DIY a pop up message tells me it's erased but when i do an erase check ROM= NOT ERASED..FUZE= NOT ERASED.. and the strange thing is that right now there's my last code which i have burned still working normally on the chip which means that it's not burned and works fine. when i try to erase the chip using DIY and then program although they it's not erased as i said above, am asked again to erase the chip as it's not erased because the program does an erase check automatically so i chose again to erase chip to continue after that an error showed in a pop up windows which is >> ROM error at 0x0000 Good 0xEF02 Bad 0xEF22 !! i press ok and the whole operation quits. the weird thing is that if i used the same hex code which is still in the chip from last's time burning, it will be programmed normally without any program but changing one single character in the hex code the problem happens !! That's my problem in erasing the chip !!

for the RA6 i guess i won't need the PIC18F452 as i am using an external crystal OSC as i wont be able to use pin 6 as an output with my crystal OSC
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top