View previous topic :: View next topic |
Author |
Message |
akokyaw
Joined: 11 Feb 2005 Posts: 24
|
Problem with output_b command |
Posted: Fri Jun 24, 2005 10:34 pm |
|
|
Hi,
I am a newbie to CCS C compiler. I want to try a led blink program. I have a problem with output_b command. The problem is I can get blinking led except the pin 3 of portb. The version of IDE is 3.6 and PCM is 3.050.
Thanks in advance,
ak
I used pic16f877 and the source code as follows:
#include <16F877.H>
#fuses XT,NOWDT,NOPROTECT
#use DELAY(clock=4000000)
#use fast_io(B)
void main()
{
set_tris_b(0x00);
OUTPUT_B(0x00); // Set all pins low
while(1)
{
OUTPUT_B(0xff); // on the I/O port pin
delay_ms(500);
OUTPUT_B(0x00); // on the I/O port pin
delay_ms(500);
}
} |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jun 24, 2005 11:25 pm |
|
|
Go to the CCS FAQ page. Look in the first section, at the question on
"Why isn't Port B, pin 3, working ?"
http://www.ccsinfo.com/faq/ |
|
|
akokyaw
Joined: 11 Feb 2005 Posts: 24
|
output_b problem |
Posted: Sat Jun 25, 2005 6:20 am |
|
|
Thanks man. It helps a lot. |
|
|
|