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.

A Chip like 16F628A with ADCs?

Status
Not open for further replies.

ClydeCrashKop

Well-Known Member
Most Helpful Member
Can anyone recommend a PIC that is really compatible with the 16F628A that has 2 or more analog to digital converters? 10 bit is good. I am familiar with the 16F628A from Nigel's tutorials and have the main board, LCD, subroutines, etc. I need to monitor 2 analog inputs. It would be real nice if I could use existing circuits and just modify my programs a little. If there isn't a pin for pin replacement, what chip would be close?
 
The 16F88 perhaps? - but most 18 pin devices are pin compatible anyway - I'm now using the enhanced 16F1827 which drops straight in the tutorial boards, but has many extra great features (and is even cheaper).
 
Thanks a lot Nigel.
I'll check out their data sheets.
 
I am using WINPICPROG and a Fox Delta parallel programmer. When programming a 16F88, I get a "Config Fuses Verify Error" every time. I have tried it on 2 chips.
It did program the chips but they were running really slow. Nigel's LED tutorial took a couple minutes to switch to the next LED instead of seconds. (Using internal clock at 4Mhz)
Do I need to upgrade something?

I got a couple 16F1827 chips but they aren't listed in WINPICPROG.
 
Last edited:
As Nigel uses this chip he may (if you ask nicely) add it to the list of supported devices...

Sorry, but parallel port programmers are long since past there sell by date :(

I moved the PICKIT2/3 a number of years ago, their low cost these days means it's not worth messing with unofficial programmers.

It's been a few years now since I even had a PC with a parallel port on :D
 
On the 16F88 the default internal oscillator is 32kHz. For 4MHz write 0x60 to OSCCON or 0x70 for 8MHz.

Mike.
 
I am using WINPICPROG and a Fox Delta parallel programmer. When programming a 16F88, I get a "Config Fuses Verify Error" every time. I have tried it on 2 chips.
It did program the chips but they were running really slow. Nigel's LED tutorial took a couple minutes to switch to the next LED instead of seconds. (Using internal clock at 4Mhz)
Do I need to upgrade something?

I got a couple 16F1827 chips but they aren't listed in WINPICPROG.

I made a pickit2 for only about £10 ... works like a charm... Pickit2 are about £24....
 
Thanks guys
I ordered a PICIT3 and a RJ-11 to ICSP adapterator (AC164 110) Is there anything else that I need?
Meanwhile, this is the program I was trying to run, just to get started with 16F88. Maybe you can find the problem.
Code:
;Tutorial 1.5 - Nigel Goodwin 2002
	LIST	p=16F88		;tell assembler what chip we are using
	include "P16F88.inc"		;include the defaults for the chip
;	__config 0x3F38			;sets the configuration settings (oscillator type etc.)
     __CONFIG    _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_ON & _WDT_OFF & _INTRC_IO
     __CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF

	cblock 	0x20 			;start of general purpose registers
		count1 			;used in delay routine
		counta 			;used in delay routine 
		countb 			;used in delay routine
	endc

	LEDPORT	Equ	PORTB		;set constant LEDPORT = 'PORTB'
	LEDTRIS	Equ	TRISB		;set constant for TRIS register
	
	org	0x0000			;org sets the origin, 0x0000 for the 16F628,
					;this is where the program starts running	
	movlw	0x07
	movwf	CMCON			;turn comparators off (make it like a 16F84)
   	movlw 	b'01100000'	;Set int osc to 4mhz
  	movwf	OSCCON & 0x7F

   	bsf 	STATUS,		RP0	;select bank 1
   	movlw 	b'00000000'		;set PortB all outputs
   	movwf 	LEDTRIS
	bcf	STATUS,		RP0	;select bank 0
	clrf	LEDPORT			;set all outputs low

Loop	
;	movlw	b'10000000'
	movlw	b'11111111'
	movwf	LEDPORT
	call	Delay			;this waits for a while!
	movlw	b'01000000'
	movwf	LEDPORT
	call	Delay			;this waits for a while!
	movlw	b'00100000'
	movwf	LEDPORT
	call	Delay			;this waits for a while!
	movlw	b'00010000'
	movwf	LEDPORT
	call	Delay			;this waits for a while!
	movlw	b'00001000'
	movwf	LEDPORT
	call	Delay			;this waits for a while!
	movlw	b'00000100'
	movwf	LEDPORT
	call	Delay			;this waits for a while!
	movlw	b'00000010'
	movwf	LEDPORT
	call	Delay			;this waits for a while!
	movlw	b'00000001'
	movwf	LEDPORT
	call	Delay			;this waits for a while!
	goto	Loop			;go back and do it again

Delay	movlw	d'250'			;delay 250 ms (4 MHz clock)
	movwf	count1
d1	movlw	0xC7
	movwf	counta
	movlw	0x01
	movwf	countb
Delay_0
	decfsz	counta, f
	goto	$+2
	decfsz	countb, f
	goto	Delay_0

	decfsz	count1	,f
	goto	d1
	retlw	0x00

	end
 
hi,
Runs OK in Oshonsoft, LED's sequence at 250mS
 
Thanks Eric
I will try Oshonsoft until my PICKIT3 gets here.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top