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.

problem with 16f628a

Status
Not open for further replies.

gang

New Member
hi, newbie here! :)

i used to work with 16f84a, i swtched to 16f628a because 1k was not enough. Problem is, the 628a pic wouldn't read inputs. I've already simulated it with oshon pic simulator and it was okay. What could be the problem?
 
gang said:
hi, newbie here! :)

i used to work with 16f84a, i swtched to 16f628a because 1k was not enough. Problem is, the 628a pic wouldn't read inputs. What could be the problem?

The 628A is the replacement for the obselete 84's (in fact it's the replacement for the 628, which was the replacement for the obselete 84's). As such it's pin for pin compatible, and 'almost' 100% software compatible - the only real difference is the extra hardware.

Your problem is too vague to mean anything - BUT, the only real code change required is two lines to turn OFF the extra comparators, which are ON by default. This is clearly explained in the datasheets and the 84 to 628 migration document.

If you check my tutorials these also include the required two lines, and are clearly commented as such.

Failing that, give more details of your problem!.
 
thanks for the info! :)

I used the same circuit for 628. As for the program, i've already included cmcon=7 to turn the comparators off, what is the other line? by the way, I use mikrobasic. Also, what command should i write to set a internal oscillator of 4 MHz?
 
gang said:
thanks for the info! :)

I used the same circuit for 628. As for the program, i've already included cmcon=7 to turn the comparators off, what is the other line? by the way, I use mikrobasic. Also, what command should i write to set a internal oscillator of 4 MHz?
You only add theese 2 lines in asembly:
Code:
MOVLW 7d
MOVWF CMCON

PIC16F628's oscilator has a fixed oscilator, you can't adjust it's frequency. To turn it on, simply adjust Config Word to INTOSC.
 
gang said:
what does INTOSC mean? i program with mikrobasic..
INTOSC is a type of oscilator used it's set in CONFIGURATION WORD, which is available durring programming, in this case "Internal Oscilator with RA6&RA7 as IO pins". I can't help you with mikrobasic. :oops:
 
i've figured it out. configuration settings can easily be edited in mikrobasic..thanks jay! 8)
 
Status
Not open for further replies.

Latest threads

Back
Top