|
|
View previous topic :: View next topic |
Author |
Message |
johnq Guest
|
PORTB direction problem!! |
Posted: Fri Jul 18, 2003 12:16 am |
|
|
I have a silly problem with CCS picc compiler. When I send to the port b, 0xFF, portb bit 4 doesnt turn to logical 1. Would you help me please..My sample code is below.
Note: Eight LEDs are connected portb. All of LEDs are lighted except bit4 later the code below.
#if defined(__PCM__)
#include <16f877.h>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=16000000)
#use standard_io(B)
#endif
void main(void)
{
output_b(0xFF);
while(1);
}
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516126 |
|
|
Kenny
Joined: 07 Sep 2003 Posts: 173 Location: Australia
|
Re: PORTB direction problem!! |
Posted: Fri Jul 18, 2003 1:19 am |
|
|
:=I have a silly problem with CCS picc compiler. When I send to the port b, 0xFF, portb bit 4 doesnt turn to logical 1. Would you help me please..My sample code is below.
:=
:=Note: Eight LEDs are connected portb. All of LEDs are lighted except bit4 later the code below.
:=
:=#if defined(__PCM__)
:=#include <16f877.h>
:=#fuses HS,NOWDT,NOPROTECT
:=#use delay(clock=16000000)
:=#use standard_io(B)
:=#endif
:=
:=void main(void)
:={
:=
:=output_b(0xFF);
:=
:=while(1);
:=
:=}
:=
:=
:=
Perhaps you mean the 4th led, bit 3?
If so, change line to
#fuses HS,NOWDT,NOPROTECT,NOLVP
Regards
Kenny
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516129 |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
Re: PORTB direction problem!! |
Posted: Fri Jul 18, 2003 9:54 am |
|
|
<font face="Courier New" size=-1>:=I have a silly problem with CCS picc compiler. When I send to the port b, 0xFF, portb bit 4 doesnt turn to logical 1. Would you help me please..My sample code is below.
:=
:=Note: Eight LEDs are connected portb. All of LEDs are lighted except bit4 later the code below.
:=
:=#if defined(__PCM__)
:=#include <16f877.h>
:=#fuses HS,NOWDT,NOPROTECT
:=#use delay(clock=16000000)
:=#use standard_io(B)
:=#endif
:=
:=void main(void)
:={
:=
:=output_b(0xFF);
:=
:=while(1);
:=
:=}
:=
:=
:=
That pin is not able to output high. Only float and output low. Try wiring the LED's to +5 instead of ground. Then you pull the pins low to turn them on.</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516149 |
|
|
Kenny
Joined: 07 Sep 2003 Posts: 173 Location: Australia
|
Re: PORTB direction problem!! |
Posted: Sat Jul 19, 2003 4:26 pm |
|
|
:=I have a silly problem with CCS picc compiler. When I send to the port b, 0xFF, portb bit 4 doesnt turn to logical 1. Would you help me please..My sample code is below.
:=
:=Note: Eight LEDs are connected portb. All of LEDs are lighted except bit4 later the code below.
:=
:=#if defined(__PCM__)
:=#include <16f877.h>
:=#fuses HS,NOWDT,NOPROTECT
:=#use delay(clock=16000000)
:=#use standard_io(B)
:=#endif
:=
:=void main(void)
:={
:=
:=output_b(0xFF);
:=
:=while(1);
:=
:=}
:=
:=
:=
Did you mean port a? Bit 4 of port a is the one that needs the pullup.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516186 |
|
|
johnq Guest
|
Re: PORTB direction problem!! |
Posted: Mon Jul 21, 2003 1:30 am |
|
|
:=:=I have a silly problem with CCS picc compiler. When I send to the port b, 0xFF, portb bit 4 doesnt turn to logical 1. Would you help me please..My sample code is below.
:=:=
:=:=Note: Eight LEDs are connected portb. All of LEDs are lighted except bit4 later the code below.
:=:=
:=:=#if defined(__PCM__)
:=:=#include <16f877.h>
:=:=#fuses HS,NOWDT,NOPROTECT
:=:=#use delay(clock=16000000)
:=:=#use standard_io(B)
:=:=#endif
:=:=
:=:=void main(void)
:=:={
:=:=
:=:=output_b(0xFF);
:=:=
:=:=while(1);
:=:=
:=:=}
:=:=
:=:=
:=:=
:=
:=Did you mean port a? Bit 4 of port a is the one that needs the pullup.
No I mean the PORTB and I solved my problem with your help. Thank you...See you..
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516215 |
|
|
|
|
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
|