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.

Strange Issues with 12F675 & ICProg!

Status
Not open for further replies.

bsodmike

New Member
Just got my new SMT programmer soldered today and it programs a 16F84A perfectly.

However, when I try to program a 12F675 with the crystal set to XT it asks me where to take the osc calib value?

In my code I disabled the section of code that makes the call and updates _osccal

Yet, I want to use the int osc just can not. For one, I use this code:

Code:
	org	00h		; the reset vector is defined as address 00hex

	call	H'03FF' 	; GET OSC CALLIBRATION 

	bsf 	_status,5 	;Bank 1
	movwf 	_osccal 	;Calibrate
	bcf 	_status,5 	;Bank 0

   	goto	setup		; and we tell it to go to 'setup'

The address 03FF is defined in the datasheet yet ICProg asks me if I want to use a value @ 33FF or 0000h ?!?

Thanks!
 
I have been reading some stuff online and I'm at a loss when it comes to actually 'recording' this osc calibration value?

Do I simply do a 'read' of the IC and look for it - (tried this, nothing!)

Some say to just use d'80' but I would like to get the correct value if possible.

I've tried this over and over, but I'm getting failed @ 0000h :shock: :shock: :cry:
 
It's quite simple, you read the value and write it down, then restore it every time you write to the chip. If you've erased or written to the chip already, you've already destroyed the calibration value. WinPicProg automatically reads and restores the calibration byte, unless it's overwritten by a value in the HEX file - this is a requirement in the programming specification, but not all programming software follows it!.
 
Dear Nigel,

How does one 'read' this? I've tried IC Prog and I see nothing at all!

I got your program installed but it simply won't see my programmer - it is JDM and this is the schem:

**broken link removed**

Using COM1

Thanks!
 
bsodmike said:
Dear Nigel,

How does one 'read' this? I've tried IC Prog and I see nothing at all!

You've probably already wiped it :cry:

I got your program installed but it simply won't see my programmer - it is JDM and this is the schem:

I don't support 'serial' programmers, they are too unreliable - probably why the author of ICProg no longer offers support?.
 
Dear Nigel - I got a pack of 5 new 12F675s of which I got 2 more that are untouched. When I read them via ICProg where do I look for the info, under the main 'program' window? I can not see the special addresses listed in ICProg?

Also, I just checked my breadboard has 13uF track to track :shock:

Will move this to the other bread board (only 15pF!) and try again....
 
bsodmike said:
Dear Nigel - I got a pack of 5 new 12F675s of which I got 2 more that are untouched. When I read them via ICProg where do I look for the info, under the main 'program' window? I can not see the special addresses listed in ICProg?

It's the very top word of memory!, scroll down the Program Code window to 0x3FF.
 
Got it the value is 3494h - I've put this in my code but it's truncating it...

This is the first time I've seen this and this is cause I swapped breadboards....

Now to the strange issue of the fail @ 0000h....I've tried I/O delay 10 and 5, both work fine on emy 16F84A's....

Any ideas?
 
bsodmike said:
Got it the value is 3494h - I've put this in my code but it's truncating it...

that's because 3494h is an complete instruction, it actually means
RETLW 0x94, so that's what you need to put in your code
 
bsodmike said:
Now to the strange issue of the fail @ 0000h....I've tried I/O delay 10 and 5, both work fine on emy 16F84A's....

have you already programmed your 12F675 with the internal oscillator turned on? if so, this causes problems with JDM since it applied power immediately to the pic it starts running it program (if intosc is selected), and from the moment it starts running it cannot be switched into programming mode...

16F84 has no problem with this cause it has no intosc.

( **broken link removed** )
 
Checked another one that has the val as 0x8C

Code:
   org   00h      ; the reset vector is defined as address 00hex 

   bsf    _status,5    ;Bank 1 
   retlw       0x8C
   movwf    _osccal    ;Calibrate 
   bcf    _status,5    ;Bank 0 

      goto   setup      ; and we tell it to go to 'setup'

This how I do it?

So how do I program this properly? Even if I choose XT it doesn't work (and I remove the int osc code!)

Looking @ your fix!

Thanks!
 
the oscillator value should be stored on address 0x3FF as a retlw instruction, so you just call that address and the calibration value is returned in W (if you didn't erease it that is)

Code:
BSF     STATUS, RP0     ;bank1
CALL    0x3FF           ;get calibration value
MOVWF   OSCCAL          ;and store it 
BCF     STATUS, RP0     ;bank 0

normally, IC-prog reads the value at address 0x3FF and asks you to keep it or to delete it, just answer to keep it and the right value remains in the pic, however, if you got a pic's calibration vaue and you want to incorporate it in your code just do...

Code:
ORG     0x3FF
RETLW   XX
where XX is the calibration value
 
Thanks alot!

Did the FET Mod to my prototype, simply pulled a wire before the diode on the 'high line' - used this to control the gate, works like a charm ;)

Now the strangeness is the I program IntOsc Clkout - but I measure pin 3, freq = 0hz voltage 2.5v?!?

Ohh boy!
 
what do you use to measure it?
It could be that the device you use to measure the frequency puts to big a load on the osc output and stops it from running
 
Used my Fluke 189 DMM. I got it programmed as XT and it works this way...now I can simulate my code finally...

Thanks Exo - you saved me alot of headaches, that MOSFET trick is what I needed ;)
 
Exo:

**broken link removed**

Thanks to that link with the info for the mosfet jobby, I've updated and shrunk the programmer some more! I might use this one day, but for now it will probably remain a file on my hdd heh :lol:
 
nice layout...

I'm going to order a pcb soon, first need to get my credit card :wink:
 
Cool - let me know when ready ;)
 
Re movwf OSCCAL

there is a special program available from microchip to calculate the OSCCAL calibration value

autocal.asm
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top