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

"VERY" simple program not working.

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







"VERY" simple program not working.
PostPosted: Mon Nov 10, 2008 8:04 am     Reply with quote

Hi to all.
Why does the following code not work.
Just turning on a pin. Only run in Mplab simulator.
Code:


#include <12f675.h>
#device icd=true
//#include "myheader.h"


#define GP0 PIN_A0
#define GP1 PIN_A1
#define GP2 PIN_A2
#define GP3 PIN_A3
#define GP4 PIN_A4
#define GP5 PIN_A5


void main(void)
{
setup_adc_ports(ADC_OFF);
setup_adc_ports(NO_ANALOGS);

set_tris_a(0x00);
output_high(GP2);


}


Cheers
Neddie
Neddie
Guest







"Very simple program not working"
PostPosted: Mon Nov 10, 2008 8:20 am     Reply with quote

Got it working.
Had the wrong device selected in mplab. My bad :0(


Cheers
neddie
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Mon Nov 10, 2008 9:29 am     Reply with quote

in my opinion you should also have a continuous while statement at the
end to prevent the PIC from going to sleep.

Code:

while(1)
{
//do nothing but loop
}
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