Serial UART Communication #650
Replies: 13 comments
-
Posted at 2014-03-13 by @gfwilliams Ahh - thanks. I'll change that. For now, just do UART/USART are actually because of the STM32 chip that's being used. A USART has a CK (clock) pin, and a UART doesn't. There's no support for the CK pin in Espruino right now, so you can actually safely assume that both UART and USART are the same. And with the pins - yes, on Espruino you've usually got a choice of which pin you put which peripheral on. However you can't put |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-13 by Sacha Many thanks Gordon. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-25 by tage this is probably a basic question: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-25 by DrAzzy I would expect it to be returned as an escaped string (ie, "\x08") - does it not do that? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-25 by tage 8-) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-25 by tage Ok, I figured out a way. There must be more elegant ways to do this, but at least now I can see what I am receiving and I can take some actions depending on the messages.
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-28 by @gfwilliams Using charCodeAt is the right way of doing it if you need a number... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-24 by user47006 Hello, So I tried to set up Serial5 to two of my available pins (B1 and B0) as but it does not seem to work. Do I need to recompile the firmware to assign serial5 to B1 and B0? Any info is appreciated. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-25 by DrAzzy That's a lotta serials... The allowable pins for each peripheral are determined by the chip, not the software - the UARTs and SPI's and I2C's shown on the reference are bits of silicon in the chip, and can only be connected to certain pins. If you need 5 serials, I'm afraid your options are to either wait for Gordon to implement software serial (this emulates serial in software, working on any pins - he's talked about doing this in other thread: http://forum.espruino.com/conversations/257119/?offset=25#comment11957278 ), or hack your Espruino board and get a wire onto D2. That would take out the SD card though (there are plans for a change to let you set the pins for SD card, but then you'd have to cut a trace and run another wire). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-25 by @gfwilliams You do have another option, which is that if you don't need serial inputs at the same time, you can use Also, In the next few weeks I should be adding support for swapping the SD card to other pins. That means you could potentially cut the trace for D2 and then use another pin for the SD card... Finally you could always use an SPI/I2C USART chip, so you can add extra UARTs that way. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-25 by user47006 Thanks for both answers. When the new changes are done to assign the SD card pins, are there any restrictions what pin I could use for the SD [CS] (replacing the current D2 ), for example can I use B0 ? thx |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-26 by @gfwilliams When changing the SD card pins is done, you should be able to use any pin for CS. The only restriction would be on using a hardware SPI port (although that may change at some point too). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-11-26 by user47006 thank you for your explanation. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-13 by Sacha
Hello Gordon,
I have a few questions regarding serial communication.
Serial1.setup is not working with parity 'none'. I got the following error:
'even' works:
Is null also 'none' ?
Second question. I'm a bit confused about the UART/USART pins. What is the difference between UART and USART ?
On the pinout reference for example "USART1 TX" is labeled on pin B06 and A09.
Thus this mean, that i can choose which pin i would like to use ?
Many thanks
Sacha
Beta Was this translation helpful? Give feedback.
All reactions