PDA

View Full Version : 16f628a to 16f88 or 16f819



savnik
- 23rd October 2006, 08:19
need to change something in the code;

savnik
- 26th October 2006, 05:49
need to change something in the code which i have , from 16f628a to 16f88 or 16f819.

mister_e
- 26th October 2006, 15:41
we need more information... the existing code and PIC... and the target PIC #

savnik
- 26th October 2006, 16:51
we need more information... the existing code and PIC... and the target PIC #
I have the code for the pic16f628a and work.
I want to replace the 16f628a with 16f88 or 16f819


DEFINE LCD_DREG PORTB 'Selection of the port B
DEFINE LCD_DBIT 0 'Selection one RB0 with RB3
DEFINE LCD_RSREG PORTA 'RS on port A
DEFINE LCD_RSBIT 2 'RS on RA2
DEFINE LCD_EREG PORTA 'E on port A
DEFINE LCD_EBIT 3 'E on RA3
DEFINE LCD_BITS 4 'Mode 4 bits
DEFINE LCD_LINES 2 '2 lines

DEFINE I2C_SCLOUT 1

PAUSE 500

' ** DEFINITION OF THE ENTREES - EXITS

' Exits I2C

SCL var PORTA.1 ' SCL on RB1 (pine 18)
SDA var PORTA.0 ' SDA on RB0 (pin 17)

' Boutons

UP var PORTB.6 'increase the frequency (on RB6)
DOWN var PORTB.7 'decrease the frequency (on RB7)
CH_PAS var PORTB.5 'Change the step of synth (on RB5)

Input UP 'Up and Down are entries
Input DOWN
Input CH_PAS

DynamoBen
- 26th October 2006, 18:44
Add the following to the top of the program:

CMCON=%00000111 ' Disable Comparators
ANSEL=%00000000 ' force RB6 and RB7 digital (16F88 specific)

savnik
- 26th October 2006, 20:06
Add the following to the top of the program:

CMCON=%00000111 ' Disable Comparators
ANSEL=%00000000 ' force RB6 and RB7 digital (16F88 specific)
Already have : CMCON = 7 ' PortA = digital I/O

DynamoBen
- 26th October 2006, 20:08
So whats the issue? Is it not compiling?

mister_e
- 27th October 2006, 03:14
i bet on the internal osc... place the following at the top of your code

OSCCON=%01110000 ' for 8MHZ operation

OR

OSCCON=%01100000 ' for 4MHZ operation