There seems to be a problem with writing bytes to output ports using the output_x function.
1 It seems to write a byte or word to a port depends on the size of the parameter (not in the manual!!!). however the default standard_oi state of changing the port to output seems to clear the tris register as a word regardless of the size of the parameter.
2 There doesnt seem to be a way to write to the top byte of the port
Is there any other function to write to the ports?
what do others do to write bytes to ports?
Thanks
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
Posted: Fri Oct 09, 2009 10:01 am
Yes. The handbook clarifies about output_x():
Quote:
Output an entire word to a port. The direction register is changed in accordance with the last specified #USE *_IO directive.
In other words, using it with standard_io in effect sets the complete 16 Bit port to output.
For selective control of latch and tristate registers as required by the application, I prefer to use the respective SFR, e.g.
my manual must be out of date it doesnt say that. It was the one i got only a month ago with the compiler upgrade. Seems little real support of the PIC24's atm. I have relready built a library of defines that give full byte and word support, would have been so easy of CCS to do that thought the compiler had been out for sometime now so strange there are so many omissions and bugs
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