It doesn't say if it should be inverted or true mode.
I did try [hex bright,0] and other permutations, like sending the Ascii value "z" instead.
I finally put a scope on it and tried to relate the command to the scope trace. This is what I got for $7A (brightness control, Ascii "z")
When I write the binary version out, it is indeed $7A or %0111 1010, except it's back to front. What I would have expected to be the msb at the front end of the trace, is at the back end. In other words, what is being sent is not $7A, but %0101 1110. (At least when I used to demonstrate RS-232 signals, they used to follow that convention). Tell me if I'm wrong.
So, what do you guys figure is happening? Maybe the inverted/true mode business? How do I choose either mode? I was looking at the REV command to reverse all the bits, but that seems rather "kludgy".
The latest code:
Code:DEFINE OSC 4 DEFINE HSER_RCSTA 80h ' Enable serial port (b7=1 to enable TX as serial port pins DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1 define HSER_BAUD 9600 'DEFINE HSER_SPBRG 25 ' 9600 Baud @ 4MHz, 0.16% DEFINE HSER_CLROERR 1 ' Clear overflow automatically trisc.6=0 LED var portc.6 '****The following are the control codes for the Sparkfun serial 7-segment display decpts con $77 ' "w" bright con $7A ' "z" setbaud con $7F '2=9600, 4=19200 reset con $76 ' "v" lsb con $7B ' "{" dig2 con $7C ' "|" dig3 con $7D ' "}" msb con $7E ' "~" 'hserout [setbaud,2] Main: HSEROUT [bright, $ff] pause 50 goto main




Bookmarks