-->
Page 1 of 5

send out ascii characters to bit stream using a GPIO pin

PostPosted: Sun Oct 01, 2017 8:42 am
by mikekgr
Dear Sirs,
in one project that I am thinking of, there is a need to send out an ASCII String ( ok not exactly ASCII but modified to 7 bits, stored to a String variable ) as a bit stream through a GPIO pin of my Wemos esp8266 MPU. The bit stream rate should be 100 bits per seconds. { 10 msec each bit, 70 msec each character, baud rate = 1000 msec / 10 msec = 100 baud }
What do you think? What is the best way to implement it?

Thanks and Best Regards,
Mike Kranidis

( For more precisely information please see the bellow link:
https://en.wikipedia.org/wiki/ARQ-M#ITA3
See at Alphabet
Of Course I will have a conversion mechanism between the palin ASCII code the the system will use to store the messages, to 7 bits coded characters and then these 7 bits coded characters will be streamed out in digital form as a 7 bits coded characters to serial output. )

Re: send out ascii characters to bit stream using a GPIO pin

PostPosted: Sun Oct 01, 2017 2:05 pm
by mrburnette
Mike,

You may wish to look over the code for ESP8266 versions for SoftwareSerial and adapt to fit your needs:

https://www.google.com/search?q=esp8266+softwareserial

Do remember that the Arduino code is time-sliced by non-OS, so you are going to have to be very careful in your timings.

Ray

Re: send out ascii characters to bit stream using a GPIO pin

PostPosted: Sun Oct 01, 2017 4:03 pm
by mikekgr
mrburnette wrote:Mike,

You may wish to look over the code for ESP8266 versions for SoftwareSerial and adapt to fit your needs:

https://www.google.com/search?q=esp8266+softwareserial

Do remember that the Arduino code is time-sliced by non-OS, so you are going to have to be very careful in your timings.

Ray


Thanks a lot dear Ray. I thought about the softwareserial but I can not modified / tailor made to my need by myself...

To give some more details:
1) I need only serialize data transmission only, not reception necessary.
2) this serialize data transmission will haven't start or stop bit(s).
3) the timing will be quite slow but need to be accurate: each bit will have 10 msec duration so the Baud rate is : 1000 msec / 10 msec = 100 Baud each character or symbol will have 7bits x 10 msec = 70 msec

Any help will be appreciated.
Best Regards,
Mike Kranidis

Re: send out ascii characters to bit stream using a GPIO pin

PostPosted: Mon Oct 02, 2017 9:01 am
by mrburnette
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