Well spotted - I apologise I was not as rigorous as I should have been - of course that was a throwaway comment on a topic already well documented in this forum. You are correct I am using a constant for the control byte - This is OK! If I had been more rigourous I would have been more specific and said please dont use constants for the Address when using a memory chip - that MUST be a variable - as per the PBP manual:
The Address size sent (byte or word) is determined by the size of the variable that is used. If a byte-sized variable is used for the Address, an 8-bit address is sent. If a word-sized variable is used, a 16-bit address is sent. Be sure to use the proper sized variable for the device you wish to communicate with. Constants should not be used for the address as the size can vary dependent on the size of the constant. Also, expressions should not be used as they can cause an improper Address size to be sent..
Of course these contraints do not apply to talking to the DAC, although I could have used byte variables.
Peter Finch
Bookmarks