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 CCS Technical Support

Newbee question

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



Joined: 13 Jun 2005
Posts: 1

View user's profile Send private message Send e-mail

Newbee question
PostPosted: Tue Jun 14, 2005 2:16 am     Reply with quote

I'm a (complete) newbee to hardware programming. I bought a prototyping kit (description may be found on: "http://www.ccsinfo.com/ace.shtml") with a PIC16F877A processor.

When I try to follow the step-by-step excercise book, I can't get the programs to work. Everything seems to work though. I connect through the debugger, and the program runs normally according to the debugger status messages. However, the LED's that are supposed to blink does not show any reaction. When I power up the card all LED's are on, but no flashing occurs when the program runs. The excercise book refers to a prototyping board called "16F877A Mini-proto board", but my card is the one depicted in the URL above. I noticed that my card has two rows (a green and a red) of 5 LED's, and the "16F877A Mini-proto board" has three single LED's, a red, green and yellow. Is there a syntactical diffrence in how to make the LED's blink on these two cards?

The code used is:
Code:

#include <16f877A.h>
#device ICD=TRUE
#fuses HS,NOLVP,NOWDT,PUT
#use delay (clock=20000000)
#define GREEN_LED PIN_A5

main() {
   while (TRUE) {
      output_low(GREEN_LED);
      delay_ms(1000);
      output_high(GREEN_LED);
      delay_ms(1000);
   }
}


The code is copy/paste from the execercise book.

Any help would be much appreciated.
Guest








PostPosted: Tue Jun 14, 2005 5:09 am     Reply with quote

It appears that a space has happened between your "f" and "uses" on fuses?
bsolas



Joined: 13 Jun 2005
Posts: 1

View user's profile Send private message Send e-mail

PostPosted: Tue Jun 14, 2005 5:26 am     Reply with quote

I agree, there seems to be an extra space between the "f" and the "u" in "fuses". However, if you copy/paste the code to an editor (ie. notepad) you'll see that it's only an illusion...
valemike
Guest







PostPosted: Tue Jun 14, 2005 8:21 am     Reply with quote

i've never used the statment "ICD=true" in the past. When I debug with the ICD, somehow MPLAB sets it all for me.

But doesn't ICD=true force the dependence of an ICD debugger to be used? That would explain why it won't work in standalone mode. Try commenting that out.
valemike
Guest







PostPosted: Tue Jun 14, 2005 8:25 am     Reply with quote

i read your original post again, and just realized that I was too hasty in writing a response.

I don't have your specific demo board, but if you say that your program runs normally but w/o the LEDs flashing, then you should check if there are any jumpers that need to be plugged in to get your LED rows to flash.

For example, I use the PICDEM-2+ board. If i want to flash the LEDs, i have to install a two-pin jumper. Otherwise, if i want to use those i/o pins for something else, i pop off the jumper and i now can use the prototyping area on the board for other things.
bsolas



Joined: 13 Jun 2005
Posts: 1

View user's profile Send private message Send e-mail

PostPosted: Wed Jun 15, 2005 12:19 am     Reply with quote

Hi valemike

Thanks a lot for your answers. Setting the correct jumper(s) seems like the answer I'm looking for. However the card wasn't shipped with any documentation on which jumpers to set when and where (and there are a lot of possibilities). Maybe I'm supposed to know this...?

I realize that the "#define GREEN_LED PIN_A5" statement refers to an address/pin on the card and that this pin probably needs to be connected somwhere else. I just don't know where...

I should probably keep looking for the documentation on the card.
bsolas



Joined: 13 Jun 2005
Posts: 1

View user's profile Send private message Send e-mail

PostPosted: Wed Jun 15, 2005 12:19 am     Reply with quote

Hi valemike

Thanks a lot for your answers. Setting the correct jumper(s) seems like the answer I'm looking for. However the card wasn't shipped with any documentation on which jumpers to set when and where (and there are a lot of possibilities). Maybe I'm supposed to know this...?

I realize that the "#define GREEN_LED PIN_A5" statement refers to an address/pin on the card and that this pin probably needs to be connected somwhere else. I just don't know where...

I should probably keep looking for the documentation on the card.
sseidman



Joined: 14 Mar 2005
Posts: 159

View user's profile Send private message

PostPosted: Wed Jun 15, 2005 9:01 am     Reply with quote

bsolas wrote:
Hi valemike

Thanks a lot for your answers. Setting the correct jumper(s) seems like the answer I'm looking for. However the card wasn't shipped with any documentation on which jumpers to set when and where (and there are a lot of possibilities). Maybe I'm supposed to know this...?

I realize that the "#define GREEN_LED PIN_A5" statement refers to an address/pin on the card and that this pin probably needs to be connected somwhere else. I just don't know where...

I should probably keep looking for the documentation on the card.


The breakout for the proto-board lives on a sticker on the front edge of the protoboard, and this sticker provides just about all the info you'll ever need. On my proto-kit The LED's occupy spaces 42-46 (clearly labeled), and A0-A5 live in spaces 15-20. Assuming your board is the same, you need to run your jumper from space 20 to space 42 to make the first LED flash.

If this sticker is missing, give ccs support a jingle, and I'm sure they'll fix you right up.

Scott
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