Use this:
DEFINE HSER_SPBRG 21 'Configuración de velocidad de USART
DEFINE HSER_TXSTA 36 'a 115200 baudios.
Now you can use hserin and hserout at 115200 bauds
Use this:
DEFINE HSER_SPBRG 21 'Configuración de velocidad de USART
DEFINE HSER_TXSTA 36 'a 115200 baudios.
Now you can use hserin and hserout at 115200 bauds
Yeah but in synchronous mode... and all that imply too![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
First of all thank you for all the kindness reply. However I still couldn't solve the problem. I think I must clearify something.
Actually I would like to use the Serin2 and Serout2 command to do the asynchronising on any of the hardware pin.
As I know the Hserout and Hserin only implemented on the certain hardware pins.
The command of the SerOut2:
SerOut2 ModemOut, ModemSpeed, ["ate0",13]
Where the
1. ModemOut = Pin to be used
2. ModemSpeed = A number from the calculation Of
[int(1000000/baudrate)-20]
3. ["ate0",13] = any string to send out to the pin
So I do not know the HSER setting will effect the SerOut2 and SerIn2 command or not.
Please help.
I know the hserout instruction is for the hardware USART, but how about the SerIn2 and Serout2 command.
Do you guys use Serin2 and Serout2 command instead of hserout?
What is the main difference between Serin2/Serout2 and hserout?
How to set the 115200 baud rate for serin2/serout2 bcoz previously i was using these command to connect to a gsm module with 19200 baud rate?
Thanks
Hi kblim,
As far as I know, you can't use baud rates higher than 38400 baud (I think) with the ser-type commands.
I'm sure you can't do 115200.
This is because the ser-type commands use a "bit-banging" approach as opposed to the hser-type commands which use the built-in usart and generate less code.
This was the first time that I heard that you can communicate at 115200 using debug though.
What are the pros and cons of that anyhow, Bruce?
Regards.
---> picnaut
The serin, serout type commands were originally designed to offer BASIC Stamp users similar commands. They all produce huge code when used because the command libraries have to cover so many various options to maintain Stamp compatibility.
Debug/Debugin produce much smaller code, and offer the higher data-rates because the library routines are much smaller.
Serin, serout commands can be used on any I/O-pins that support digital I/O. Data-rates & pins used can be changed on the fly. Debug/Debugin pins & data-rates are fixed with the DEFINE used to set them up, but offer much higher data-rates since the library routines are much smaller.
If you need higher baud rates with slower osc speeds, then use Debug and Debugin if you can live with fixed rates & pins you can use.
Of course you can use them all if needed, but I'll normally opt for the hardware USART or Debug/Debugin.
Bookmarks