Welcome! Log In Create A New Profile


Using UART1 in BV509

Posted by enrher 
Using UART1 in BV509
November 21, 2015 08:07AM

I am traying to use UART1 in BV509 for connecting a GPS module in the ESP8266 connector. I've attached the TX pin to the RX of the GPS and the RX to TX, but I am not able to get the GPS messages. I know that the GPS is working, as the led showing that it is attached is flashing. Rookie 3 is installed.The code I am using is:

function gps()

dim power, nchar, nmea$, car

// rx,tx
pps_in(*U1RX(),*RPF2()) // RX pin set to U1RX
pps_out(*RPF3(),*U1TXs()) // TX pin set to U1TX (NOTE the U1TXs)

io_pinRole(*RF3(),IN,WOFF) // set up RF3 (UART RX) for input
io_pinRole(*RF2(),OUT,WOFF) // set up RF2 (UART TX) for output

io_pinRole(*RE6(),OUT,WOFF) // set up RE6 (Power on) for output
io_pinSet(*RE6(),1) // the ESP 8266 power is on

power = io_pinGet(*RE6()) // realmente tras el reset RE6 está ON

if power = 1
print "GPS encendido"
print "GPS apagado"

comclose(1) // cierra UART 1, para limpiar.

comopen(1,9600,128) // UART,Baud,Buffer_size
// COM 1, 9600 by default in GPS

while comkey?(2) = 0
nchar =comkey?(1)
if nchar >0
print "chars: ", nchar
print "/n"
print nmea$
print "/n"
nchar =0



Could you help me to see why it is not working?


Re: Using UART1 in BV509
November 21, 2015 10:02AM
The BV509 is already setup to use UART1 for the ESP8266 on specific pins for that socket. If you go to the link:


and open the Rookie_2.zip file in there there is a file called ESP8266_509.bas. This has the code for connecting to UART1 using the ESP8266 connector. See the function wf_start(). In fact there are some functions in there that may be very useful for GPS

By the way the pins are TX RF3, RX RF2

Re: Using UART1 in BV509
November 22, 2015 10:55AM
After implementing the code you pointed out, I realized that I had a wiring mistake, and once corrected it is working now.

Thanks for your help.

Sorry, you do not have permission to post/reply in this forum.