PDA

View Full Version : Small problem with PIC12F629



luxornet
- 13th March 2010, 18:54
Hi there!
I try in proteus something like this with PIC12F629:



trisio = %11111000
PORTA.0 = 1
pause 1000
PORTA.1 = 1
pause 1000
PORTA.2 = 1
pause 1000


I expected to make PortA.0 high, after 1 seconds to make PORTA.0 and PORTA.1 high and after another second to have all PORTA.0, PORTA.1, PORTA.2 high.

But the things works another way: after 1 seconds PORTA.0 become low and only PORTA.1 is high; after another 1 second, PORTA.0 and PORTA.1 become low and PORTA.2 is high.
I dont understand why making a bit high toggle low the rest.
Any ideea?
Thank you.

luxornet
- 13th March 2010, 19:03
Well,

cmcon = 7
solve the problem.
Thank you!

luxornet
- 14th March 2010, 07:33
Now I got another problem.
When I try to use icprog (JDM Programmer) I got a message that Oscillator clock is bad. My code is here:


INCLUDE "modedefs.bas"

@ device PIC12F629, intrc_osc_noclkout; Use internal oscilator
@ DEVICE PIC12F629, MCLR_OFF ; Turn off internal reset
trisio = %11111000
cmcon = 7

What can I do?

luxornet
- 14th March 2010, 09:21
The error message is:
"No oscillator callibration value found"

Acetronics2
- 14th March 2010, 10:26
Hi, Luxor

I hope for you you didn't erase your chip before ...

could you read the value located @ 3FF location ( last Program memory location )

IF something different from 3FFF ... note the value preciously.

IF 3FFF then change it to something like 3420h to 3450h ... you've lost your calibration value, and the intosc won't be very precise now ... ( use only external Xtal if precision required ! )

not very easy to recover, but Pickit 2 ou 3 have a special recovering tool ( see around you if a friend has one ...)

Alain

Archangel
- 14th March 2010, 17:33
I fought with that on, I think it was a 675, or maybe a 683, anyway I tried the JDM and the PICKit2, even tried to regenerate using PICKit2 to no avail. Then I got the PICKit1 from Bruce and it worked without a hitch. I cannot say why, only that it seems to be a programmer issue.

grounded
- 15th March 2010, 02:54
on the 12f629
should it be GPIO.0 not PORTA.0

WILL PORTA WORK