-->
Page 1 of 1

Porting a library from ATMega to ESP8266 (UART issue)

PostPosted: Sat Oct 21, 2017 1:19 pm
by Michael Teeuw
I'm working on a project in which I want to replace an Arduino Nano with an ESP8266. The one and only library I'm using uses some direct UART controlling using calls like:
Code: Select allUBRRH = 0;
UBRRL = 0x0F;
UCSRA = 0;
UCSRB = (1<<RXEN) | (1<<TXEN) | (1<<RXCIE) | (1<<UCSZ2);
UCSRC = (1<<UCSZ1) | (1<<UCSZ0);

Since the ESP8266 doesn't have the same registers, this obviously ain't going to work (it doesn't compile). Is there a simple way to convert this to ESP8266-specific code? Or will this be a very tedious and error-prone task?

Re: Porting a library from ATMega to ESP8266 (UART issue)

PostPosted: Sat Oct 21, 2017 2:32 pm
by schufti
up to now you are the only one who knows what that library is doing and how complicated it might be to achieve this on the esp8266 ...

Re: Porting a library from ATMega to ESP8266 (UART issue)

PostPosted: Sat Oct 21, 2017 9:09 pm
by rudy
Is there a simple way to convert this to ESP8266-specific code?


No. What you would need to do is to reverse engineer the code and then rewrite it.