-
-
Notifications
You must be signed in to change notification settings - Fork 284
SoftwareSerial #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Maybe? I am not if anyone has tried using a Soft serial port yet. What type of debugging are you trying to do? Just console line prints? |
Certainly not, because softserial relies on pinchange Interrupts, which itself use pin mapping. This works only on specified ports and Pins.
--
Diese Nachricht wurde von meinem Android Mobiltelefon mit WEB.DE Mail gesendet.Am 24.02.17, 01:44, dlabun <[email protected]> schrieb:
Maybe? I am not if anyone has tried using a Soft serial port yet.
What type of debugging are you trying to do? Just console line prints?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi @dlabun @MartinRobotz do you mean for specialized pins that supports pin interrupt, Software Serial works? Thanks guys! |
For these pins it will work, but you need to know their mapping and the corresponding interrupt vector number PCINT0,1,2.... Then you have to adapt the SoftSerial library and put these interrupt vectors in the ISR. Every arduino uses different PCINT vectors for pin change interrupt. In theory that should be enough. Have a try. |
@andriyadi What I use do to with Microchip PICs when I ran out of UARTs is run all of my debugging information out over an I2C to UART bridge. It could be an option for you, check out the NXP website below. |
SoftwareSerial is not supported at the time. However, I believe it should be possible to port the AVR SoftwareSerial and CurieSoftwareSerial (Arduino 101) SoftwareSerial libs to nRF5x boards. Pull requests welcome. |
In case its any use. @rayburnette ported the PJRC version of SoftwareSerial STM32 See (Pauls original post was here https://forum.pjrc.com/threads/17461-SoftwareSerial-doesn-t-compile-for-Teensy-3-it-seems but there may be an updated version somewhere else) Edit, The ESP8266 guys also now have software serial, so that may also be a good starting point in terms of porting.... |
I finally went to SC16IS740/50/60 route. Forked this library and add some convenient methods. Here's my repo: https://github.com/andriyadi/UART_Bridge I'm using Sparkfun's breakout to test it out. |
I am fairly familiar with the SoftwareSerial library, and this looks like a pretty up to date port : It needed a slight mod as the attachInterrupt function doesnt return the bitMask, but the problem is that it didnt work for me using this core. I tried the simple hardware/software serial echo example and it stalled after the first software print. Very wierd as the cores are very similar, and i assume it works for the arduino core |
@micooke can confirm this! - Have done the same. but it doesen't work correctly. I swichted then over to Adafruit nRF52, because they have done the same and it does also not work (on my side)) I I asked in the Adafruit forum. I don't know but for hattach it does work - we couldn't solve it at the moment. By the way - the original Arduino Primo SoftwareSerial on their HAL is fully functionall at all! |
@prjh - thanks for the confirmation. I might have a look at it today. The only thing i can think of it a conflict with the interrupt, which makes no sense as there isnt anything using the gpiote as far as i can tell. Yes, im working with the adafruit one as well - the arduino-org one seems identical |
Looking at WInterrupts.h, it looks fine. I would make a couple minor changes, but everything I've tried hasnt worked. I might try to resolve this with a simpler pinchange test first, but two three things stand out.
I've made these changes locally (only the first one should affect a simple example), no dice.
|
@dlabun, @sandeepmistry - the issue is in Arduino.h, three #defines are incorrect. //#define digitalPinToPort(P) ( &(NRF_GPIO[P]) ) // INCORRECT - possible seg fault
#define digitalPinToPort(P) ( NRF_GPIO )
//#define portOutputRegister(port) ( &(port->OUTSET) ) // INCORRECT
#define portOutputRegister(port) ( &(port->OUT) )
//#define portModeRegister(port) ( &(port->DIRSET) ) // INCORRECT
#define portModeRegister(port) ( &(port->DIR) ) I can create a PR with this fix. Are are you interested in supporting the SoftwareSerial library as i can pull this in at the same time? With these fixes (@prjh - this is the same problem in the adafruit core, they have 2 incorrect), the SoftwareSerial library from Adafruit (https://github.com/adafruit/Adafruit_nRF52_Arduino/tree/master/libraries/SoftwareSerial) or Arduino (https://github.com/arduino-org/arduino-core-nrf52/tree/master/libraries/SoftwareSerial) should work fine. My local version is based off the adafruit one (the arduino one looks identical) hacked with Tx/Rx only & half-duplex options, so it will take a while to regression test these for full confirmation. |
@micooke Congratulation! I have tested SoftwareSerial with the attachInterrupt() changes and the above #defines well with a nRF52-DK board. Up to 38400 baud, it does work straight forward. In my tests with the Arduino Primo implementation I got baud rate up to 74880 - don't know why at the moment. Never the less it does work - Thanks for your investigation. |
I have created a PR for the core side without a SoftwareSerial library, but i am happy to add this in. |
Just a note that ive added SoftwareSerial to the PR. @prjh - im not sure why the primo out performs? I will say that the tuning is very coarse for most non-avr variants of this library as they use |
a question: |
Not at this time |
@micooke - I tested it, It works. Thank you very much ;) |
You are very welcome |
any update or plan for out of box software serial? or some complete tutorial how do get it work now. Thank you (if not, that please write some verified I2C - UART bridge) |
Is it possible to use SoftwareSerial?
I have a requirement to communicate with a serial module. While the main/hardware serial is used for debugging, need another serial port to communicate with that module.
Please advice. Thanks.
The text was updated successfully, but these errors were encountered: