PDA

View Full Version : 12F509 doesn't do anything



madphys
- 30th January 2010, 21:49
Hello!

I already had this problem once, but didn't solve it back then but it kept my mind busy so I decided to return to this and solve it, but with no luck.

I cannot make a 12F509 chip to work with internal oscillator (to be honest - I haven't tried external oscillator or another 509) - something goes wrong. I program the chip with Pickit2 incircuit programmer (I use an adapter so its clean) but it doesn't do anything. I can program the same recompiled file into the 12F675 and it works lika a charm. I have tried both - Melabs Assambler and MicroChip's assambler - same thing - nothing. I suspect that during write, programmator changes the config word or something. Maybe the problem is trivial, but I am not an experienced person so I don't know what I am doing wrong. Please turn me to the right direction!

So the code is extremely simple - blinking led (don't laugh - I want to start the chip running at first).


@ __config _IntRC_OSC & _WDT_ON & _MCLRE_OFF & _CP_OFF

DEFINE OSC 4
Pause 500

Start:
High GPIO.2
Pause 1000
LOW GPIO.2
Pause 200
High GPIO.2
Pause 200
Low GPIO.2
Pause 300
Goto Start
EnD



It compiles with no errors (I told that it runs smoothly on 675)

Thank you!

Darrel Taylor
- 31st January 2010, 02:21
Try adding ...
OPTION_REG.5 = 0 ; T0CS internal
Which gives you back the TRIS bit so you can change GP2 to output.

madphys
- 31st January 2010, 09:00
Nothing changed but thanks anyway!

Update:
Sorry for this silly bothering - I managed to get it running. Seems that the problem was caused by forgetting to comment out config line in the picbabsic include file. But still I am not sure if that was the real problem, because I also initially modified the default include file to use internal RC and to convert MCLR to input but it didn't work. This stays a mystery.