Sending Binary or Hex values to PC using Serout?
I am trying to send a word value to my PC from the SX48
I am breaking it down into cntr_LSB and cntr_MSB and using:
But I am receiving the Ascii character not the value of the variable.
Can this be sent out as a HEX or Binary value?
Also I clocked each Serout statement to be 2.1 ms with my 4mhz osc and the Sim.
I am using these statements in an interrupt that triggers as fast as every 1 ms
from:
·
What options do I have for sending out these values faster? I must keep my 4mhz osc.
I am breaking it down into cntr_LSB and cntr_MSB and using:
SEROUT TX, Baud, cntr_lsb SEROUT TX, Baud, cntr_msb
But I am receiving the Ascii character not the value of the variable.
Can this be sent out as a HEX or Binary value?
Also I clocked each Serout statement to be 2.1 ms with my 4mhz osc and the Sim.
I am using these statements in an interrupt that triggers as fast as every 1 ms
from:
PulsePin PIN RB.7 INPUT INTR_RISE ' Interrupt on rising edge
·
INTERRUPT NOPRESERVE ' ========================================================================= WKPND_B = 0 ' Clear interrupt pending bit (Do this FIRST) INC cntr 'If cntr=0 then ' Inc Cntr2 'endif SEROUT TX, Baud, cntr_lsb SEROUT TX, Baud, cntr_msb 'SEROUT TX, Baud, cntr2_lsb'SEROUT TX, Baud, cntr2_msb RETURNINT
What options do I have for sending out these values faster? I must keep my 4mhz osc.
Comments
Since you did not disclose the baud rate you are presently using, the first thing to do is make sure you are using the fastest baud rate possible for your setup.
Also, is it really necessary to send the count value each time you increment the count? Maybe you could increment the count and set a “There is a New Count Available” flag in your interrupt routine. Then have your main program check this flag periodically. If it is set, clear it and send the newest count value. This will allow you to count much faster than your present arrangement, which is hindered by the speed at which you can send the data.
There may well be other solutions available to you. However, I think most people will require more information about what you are trying to accomplish before they can offer any meaningful help.
- Sparks
It made my serial adventures much nicer [noparse]:D[/noparse]