CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

12f675 will not run

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Mick Kent
Guest







12f675 will not run
PostPosted: Tue Aug 05, 2003 8:23 am     Reply with quote

I have been trying for a week to get this 8 pin bugger to flash a led with no luck. I search the list back 500 days and tried many suggestions. I am running 3.169 so I tried the wizard; no luck. Code below:

#include <12F675.h>
#use delay(clock=4000000)
#fuses INTRC,BROWNOUT,NOWDT,PUT,NOMCLR

#define GREEN_LED PIN_A2

#byte ADCON0=0x1f
#byte ANSEL=0x9f
#byte CMCON=0x19

main() {
ADCON0=0;
ANSEL=0;
CMCON=7;
while(true) {
output_low(GREEN_LED);
delay_ms(1000);
output_high(GREEN_LED);
delay_ms(1000);
}
}
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516674
Felix Althaus



Joined: 09 Sep 2003
Posts: 67
Location: Winterthur, Switzerland

View user's profile Send private message

Re: 12f675 will not run
PostPosted: Tue Aug 05, 2003 8:35 am     Reply with quote

Hello

Perhaps you should place a "retlw [OSCCAL-VALUE]" at the last program memory place. I had the same problem with a 12C674, and I think here it's the same thing:
The compiler knows that this chip should have an osscal value on the last prog memory adress and so he puts a "call [last address]" (look at your lst file) and if there isn't a retlw xx the pc goes back to address 0 = pic resets, and does the call again, ... and so on.

I wrote a #rom 0x7FF = {0x34xx} in the code (xx is the calibration value)

may this helps
Felix
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516675
Mick Kent
Guest







Re: 12f675 will not run
PostPosted: Tue Aug 05, 2003 8:43 am     Reply with quote

:=Hello
:=
:=Perhaps you should place a "retlw [OSCCAL-VALUE]" at the last program memory place. I had the same problem with a 12C674, and I think here it's the same thing:
:=The compiler knows that this chip should have an osscal value on the last prog memory adress and so he puts a "call [last address]" (look at your lst file) and if there isn't a retlw xx the pc goes back to address 0 = pic resets, and does the call again, ... and so on.
:=
:=I wrote a #rom 0x7FF = {0x34xx} in the code (xx is the calibration value)
:=
:=may this helps
:=Felix
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516676
Mick Kent
Guest







Re: 12f675 will not run
PostPosted: Tue Aug 05, 2003 8:49 am     Reply with quote

Thanks very much, Felix; I had tried that but got the address wrong. It finally flashes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516679
Kobra
Guest







Re: 12f675 will not run
PostPosted: Fri Aug 15, 2003 9:15 am     Reply with quote

I also have the same problem as yours. Could you tell me how to make it work? I use the same code as yours to test. Thanks.

_Kobra_



:=I have been trying for a week to get this 8 pin bugger to flash a led with no luck. I search the list back 500 days and tried many suggestions. I am running 3.169 so I tried the wizard; no luck. Code below:
:=
:=#include <12F675.h>
:=#use delay(clock=4000000)
:=#fuses INTRC,BROWNOUT,NOWDT,PUT,NOMCLR
:=
:=#define GREEN_LED PIN_A2
:=
:=#byte ADCON0=0x1f
:=#byte ANSEL=0x9f
:=#byte CMCON=0x19
:=
:=main() {
:=ADCON0=0;
:=ANSEL=0;
:=CMCON=7;
:= while(true) {
:= output_low(GREEN_LED);
:= delay_ms(1000);
:= output_high(GREEN_LED);
:= delay_ms(1000);
:= }
:=}
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516997
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group