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.

How to use the internal oscillator of 16f628a?

Status
Not open for further replies.

apocrypha

Newbie level 2
Joined
Feb 26, 2005
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,296
I used to program with 16f84a but the memory was not enough so I switched to 16f628a. In 84a, I used portb to drive a 4-bit LCD and porta as input.

How can I use the internal oscillator of 628a? How shall I initalize porta if i use RA6 and RA7 for xt oscillator, trisa=%00111111 or %11111111? or how does the chip read the RA6&7 pins when used for xt, 0 or 1? Also, what changes in the program should I consider? I use mikrobasic..help! :(
 

porta of 16f628a

apocrypha said:
I used to program with 16f84a but the memory was not enough so I switched to 16f628a. In 84a, I used portb to drive a 4-bit LCD and porta as input.

How can I use the internal oscillator of 628a? How shall I initalize porta if i use RA6 and RA7 for xt oscillator, trisa=%00111111 or %11111111? or how does the chip read the RA6&7 pins when used for xt, 0 or 1? Also, what changes in the program should I consider? I use mikrobasic..help! :(

Try www.winpicprog.co.uk there are loads of tutorials on the 16F628 perhaps you will find your answers there.

Good Luck
 

16f628a porta portb mikrobasic

Configuration bits are mostly done during the programming of the microcontrollers.

Read the PIC16F628A, it can give more details.
 

16f628a configuration bits

You can used RA7+RA6 as XT osc and used RB2 and RB3 substitute. And change a little bit of your code like:
MOVLW B'00000011'
MOVWF TRISB
BANKSEL PORTB
But for PIC PORT A you can select which one output or input depend on bit selection such as
MOVLW B'11110000'
MOVWF TRISA
that mean RA7, RA6, RA4 as input, RA3-RA0 as output

Good luck!
 

help with 16f628a configuration?

mit said:
You can used RA7+RA6 as XT osc and used RB2 and RB3 substitute. And change a little bit of your code like:
MOVLW B'00000011'
MOVWF TRISB
BANKSEL PORTB
But for PIC PORT A you can select which one output or input depend on bit selection such as
MOVLW B'11110000'
MOVWF TRISA
that mean RA7, RA6, RA4 as input, RA3-RA0 as output

Good luck!

Using the XT pins as an I/O requires configuring the CONFIGURATION WORD and not just by setting the equivalent TRIS registers.

Read your PIC16F628A datasheet.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top