dear sir I am writing c code to write to rs232 port using aduc831 kit SBUF=1+48; SBUF=1+48; SBUF=1+48; SBUF=1+48; initially sbuf didnt take SBUF=1 doing above it did but now want to send nibble continuously from io port P3 such that it should display 0 to 0f on hyperterm now frm program 0f 1111 should be displayed on hyperterm.kindly help regards khn
If you have a byte that you want to emit as nibbles, you can get the values to print with: Low nibble:
SBUF = (num & 0x0f) + '0';
High nibble:
SBUF = ((num >> 4) & 0x0f) + '0';
If "num" is a 16-bit number, you just have to shift 8 and 12 steps to get the other two nibbles.
By the way - do not format your text as code. It is _only_ source code that should use the "pre" tags - notice how your original post becomes very wide? Text within the pre tag doesn't get any automatic line breaks, so you can quickly create truly borked message threads. Too clever formatting is a good way to get people to ignore your posts.
Per posted: you can't normally feed SBUF multiple values directly after each other, unless your specific chip have a FIFO
is the very basic problem 48+1 would, with proper coding, produce a '1'. The other issues should follow
Erik
Even if your specific chip does have a FIFO, you still need to take steps to ensure that you don't over-fill it!