Truncated match.
PICList
Thread
'In C, how do you set a pin to high voltage?'
2010\05\28@173127
by
Xiao Xu
To set, for example RA0, to high in C, can you just do PORTA0=1?
- Xiao Xu
2010\05\28@175412
by
Bruno L. Albrecht
compiler?
In C18, it's PORTAbits.RA0=1;
On Fri, May 28, 2010 at 6:31 PM, Xiao Xu <spam_OUTxiaoxu193TakeThisOuT
gmail.com> wrote:
> To set, for example RA0, to high in C, can you just do PORTA0=1?
> - Xiao Xu
> -
2010\05\28@181120
by
Mike Hagen
Try it in your particular C. See if it works or gives an error. Search
Help? Look with Sim to see what works?
On 5/28/2010 2:31 PM, Xiao Xu wrote:
> To set, for example RA0, to high in C, can you just do PORTA0=1?
> - Xiao Xu
>
2010\05\28@181415
by
Xiao Xu
I'm using the HI-TECH C Compiler LIte
- Xiao Xu
On Fri, May 28, 2010 at 5:53 PM, Bruno L. Albrecht <.....brunolalbKILLspam
@spam@gmail.com> wrote:
> compiler?
> In C18, it's PORTAbits.RA0=1;
>
> On Fri, May 28, 2010 at 6:31 PM, Xiao Xu <xiaoxu193
KILLspamgmail.com> wrote:
>
>> To set, for example RA0, to high in C, can you just do PORTA0=1?
>> - Xiao Xu
>> --
2010\05\28@181815
by
Bruno L. Albrecht
I'm not sure, but perhaps PORTA.RA0=1; may work...try that
On Fri, May 28, 2010 at 7:13 PM, Xiao Xu <.....xiaoxu193KILLspam
.....gmail.com> wrote:
{Quote hidden}> I'm using the HI-TECH C Compiler LIte
> - Xiao Xu
>
>
>
> On Fri, May 28, 2010 at 5:53 PM, Bruno L. Albrecht <
EraseMEbrunolalbspam_OUT
TakeThisOuTgmail.com>
> wrote:
> > compiler?
> > In C18, it's PORTAbits.RA0=1;
> >
> > On Fri, May 28, 2010 at 6:31 PM, Xiao Xu <
xiaoxu193
spam_OUTgmail.com> wrote:
> >
> >> To set, for example RA0, to high in C, can you just do PORTA0=1?
> >> - Xiao Xu
> >> --
2010\05\28@184514
by
Oli Glaser
----- Original Message -----
From: "Xiao Xu" <@spam@xiaoxu193KILLspam
gmail.com>
To: "Microcontroller discussion list - Public." <KILLspampiclistKILLspam
mit.edu>
Sent: Friday, May 28, 2010 11:13 PM
Subject: Re: In C, how do you set a pin to high voltage?
> I'm using the HI-TECH C Compiler LIte
> - Xiao Xu
Okay, there should be some examples/info in the documentation to get you
going with things like this.
However, I've only used it a couple of times, but I remember having trouble
finding such basic info even in the bundled documentation. I *think* you can
just use something like RA0 = 1; for individual bits. Give that a go too.
2010\05\28@201357
by
Xiao Xu
nope. I tried PORTAbits.RA0=1, PORTA.RA0=1.
During debugging, I looked into the file register, and 0x05 (location
for PORTA) never changed from 0.
- Xiao Xu
On Fri, May 28, 2010 at 5:53 PM, Bruno L. Albrecht <RemoveMEbrunolalbTakeThisOuT
gmail.com> wrote:
> compiler?
> In C18, it's PORTAbits.RA0=1;
>
> On Fri, May 28, 2010 at 6:31 PM, Xiao Xu <spamBeGonexiaoxu193spamBeGone
gmail.com> wrote:
>
>> To set, for example RA0, to high in C, can you just do PORTA0=1?
>> - Xiao Xu
>> --
2010\05\28@201516
by
Xiao Xu
btw, here is my code if it helps:
#include <pic.h>
void main()
{
RA0=1;
PORTAbits.RA0=1;
NOP();
}
the 0-bit of PORTA(0x05 for 16F684) refuse to turn into 1!
- Xiao Xu
On Fri, May 28, 2010 at 8:13 PM, Xiao Xu <TakeThisOuTxiaoxu193EraseME
spam_OUTgmail.com> wrote:
{Quote hidden}> nope. I tried PORTAbits.RA0=1, PORTA.RA0=1.
> During debugging, I looked into the file register, and 0x05 (location
> for PORTA) never changed from 0.
>
>
> - Xiao Xu
>
>
>
> On Fri, May 28, 2010 at 5:53 PM, Bruno L. Albrecht <
RemoveMEbrunolalb
TakeThisOuTgmail.com> wrote:
>> compiler?
>> In C18, it's PORTAbits.RA0=1;
>>
>> On Fri, May 28, 2010 at 6:31 PM, Xiao Xu <
xiaoxu193EraseME
.....gmail.com> wrote:
>>
>>> To set, for example RA0, to high in C, can you just do PORTA0=1?
>>> - Xiao Xu
>>> --
2010\05\28@203056
by
Oli Glaser
Something like this might work ( I assume you have the various config bits
set properly? watchdog timer off etc):
#include <pic.h>
void main()
{
PORTA = 0x00;
TRISA = 0x00;
RA0=1;
while(1); // wait here
}
2010\05\28@203639
by
Dwayne Reid
For what its worth, I don't see anything that sets the TRIS bits for
that port. Or is that something that the compiler is supposed to take care of?
dwayne
At 06:14 PM 5/28/2010, Xiao Xu wrote:
{Quote hidden}>btw, here is my code if it helps:
>
>#include <pic.h>
>void main()
>{
>
>RA0=1;
>PORTAbits.RA0=1;
>NOP();
>}
>
>the 0-bit of PORTA(0x05 for 16F684) refuse to turn into 1!
>
>- Xiao Xu
--
Dwayne Reid <EraseMEdwayner
planet.eon.net>
Trinity Electronics Systems Ltd Edmonton, AB, CANADA
(780) 489-3199 voice (780) 487-6397 fax
http://www.trinity-electronics.com
Custom Electronics Design and Manufacturing
2010\05\28@225106
by
RussellMc
Hat: Helpful.
Please note that ALL posts should have a valid tag.
[PIC] In C, how do you set a pin to high voltage?
Please add a valid tag to future posts in this thread.
Posts without a valid tag are probably seen by far less people than expected
and you may get less help than you expect.
Valid tags are preset by the system and are described in the FAQ.
at http://www.piclist.com PIC / SX FAQ&list archive
eg [PIC], [EE], [TECH], [OT], [AD], [AVR] .... etc
Russell
More... (looser matching)
- Last day of these posts
- In 2010
, 2011 only
- Today
- New search...