Searching \ for '[PIC]: Toggling bits in Hi-Tech PICC-18?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'Toggling bits in Hi-Tech PICC-18?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Toggling bits in Hi-Tech PICC-18?'
2003\04\15@094245 by Graham North

flavicon
face
Hi everyone,

I'm just starting with C on the Pic, and can't figure this out.

How do you toggle bits in Hi-Tech PICC-18? Just as 'btg' would in assembler?

Thanks

Graham

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2003\04\15@103148 by Scott Dattalo

face
flavicon
face
On Sat, 12 Apr 2003, Graham North wrote:

> Hi everyone,
>
> I'm just starting with C on the Pic, and can't figure this out.
>
> How do you toggle bits in Hi-Tech PICC-18? Just as 'btg' would in assembler?

I bet all you have to do is:

 some_bit ^= 1;

Where some_bit is a variable of type bit. Knowing HiTech, it's smart
enough to turn this into a btg instruction.

Scott

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2003\04\15@103159 by hael Rigby-Jones

picon face
> -----Original Message-----
> From: Graham North [SMTP:graham.northspamKILLspamCIRRUSRESEARCH.CO.UK]
> Sent: Saturday, April 12, 2003 1:56 PM
> To:   .....PICLISTKILLspamspam.....MITVMA.MIT.EDU
> Subject:      [PIC]: Toggling bits in Hi-Tech PICC-18?
>
> Hi everyone,
>
> I'm just starting with C on the Pic, and can't figure this out.
>
> How do you toggle bits in Hi-Tech PICC-18? Just as 'btg' would in
> assembler?
>
> Thanks
>
> Graham
>
Something like
LATA0 = !LATA0;

or

LATA ^= 0b00000001;

should do the trick.

Regards

Mike



=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to EraseMEpostmasterspam_OUTspamTakeThisOuTbookham.com.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...