Andy David wrote: > > your structure of bit definitions is ok (although I think you > > should consider using "unsigned int :1" rather than > > just "unsigned :1"), but you can't have a pointer to > > a bit (K&R page 150). Francisco Ares wrote: > Check the files to see how they do this things with ports > and registers. Francisco, just to clarify: I meant that you can't have a _pointer_ to a bit in C, I wasn't commenting on the ability of the PIC architecture to set/clear and test bits. C does allow some operations on bit field types, but & isn't one of them. If...: struct { unsigned notify : 1; unsigned valid : 1; unsigned finish : 1; unsigned demo : 1; unsigned alert : 1; unsigned encourage : 1; unsigned exercise : 1; unsigned grace : 1; } flags; pointer = &flags.notify; ... really does work with HT-PICC18, it's an extension to C, probably because the bit addressing modes of the PIC18 core are more sophisticated than the other PIC cores, making a pointer to a bitfield a more reasonable proposition than on the other cores. Apologies if my post wasn't clear. - Andy. ---------------------------------------------- Andrew David, Software Manager, Ultronics Ltd http://www.Ultronics.com _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads