On 19/03/2015 11:35, Josh Koffman wrote: > Hm...interesting. It took me about 45 minutes to get this working, > mainly because the compiler suddenly decided to not like how I was > declaring the variable, even though I hadn't touched that part of the > code, and it was working last night. Awesome. I'm sure I did > something, but who knows what. So yes, now it appears that this is > working. I will have to do some simulation to make sure it's writing > to the bits correctly, but at least it compiles now. To the 8/16bit > point that a few people have raised. Is it that by declaring as > "unsigned XXX :1;" I'm declaring XXX to be a single bit out of and > unsigned int which is 16 bits? I just want to make sure I understand. > I thought that by declaring only 8 bits the compiler would make it an > 8 bit variable. But then, I've been used to assembly for so long that > I keep forgetting things aren't automatically 8 bits. Thanks! Josh=20 By declaring the field "unsigned", you are saying to the compiler you want an "unsigned int" which is 16 bits (or 32 bits, depending on the architecture) long, even if you don't use them all. The remaining bits stay unassigned and unaccessible but takes space. By declaring the field "unsigned char" you are saying you want a basic type of 8 bits. I think that the standard limits bit fields to "int" size, but most compilers will accept it with "char" size. Isaac --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .