Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By mikekgr
#70545
mrburnette wrote:Mike,

Please reference my respose to Urs in this link:
viewtopic.php?f=29&t=16124

The fact that loop() is always interrupted by a call to the background means that your Arduino code must understand it is not the only task running. Therefore timing concepts used in an AVR arduino world may fail under ESP8266 Arduino.

An option may be the newer ESP32 chip but I do not know the maturity of the "Arduino core" :

https://github.com/espressif/arduino-esp32

Ray


Thanks a lot Ray. I will seriously consider your points.
User avatar
By mikekgr
#70716
zdewitt wrote:Mike,
Making what appears to be a custom serial port is a perfect job for either the timer1 arduino library or the ESP8266 os_timer library. Set up a buffer for the data and let the timer callback twiddle the bits every 10ms

Hope this helps


Dear zdewitt,
thanks for your reply. I have thought the same but I am not very capable to mock up the related sketch.
Your contribution will be highly appreciated.
Another thing I thinking is to modify the softwareserial library, to kick out start, stop bit and to make it to send 7 bits. My C++ level does not help me to do this...

Thanks and Best Regards,
Mike Kranidis
User avatar
By tele_player
#70726 The modification for 7 bits is extremely simple, have you looked at SoftwareSerial.cpp?
Note: rxRead() might trick you, since it is written using 0x80 and right shift. I'd change it to 0x01 and left shift, so it can handle 7-bit correctly simply by changing the loop limit.

I'd mod software serial to have a method for setting a variable for bits., rather than constant 8.

These mods would take a minute to do. It might take a few minutes, or an hour, to figure out. Hint: there are two loops with 8 hard-coded, and one place where 0x80 is OR'ed into the received byte.