B4R Question Serial port question

whcir

Member
Licensed User
Longtime User
Can the serial port that is used to program the arduino be used by the device after it is disconnected from the programming computer? What are the optional config parameters in "Initialize2 (BaudRate As ULong, Config As Byte)" As void. Also, can the program be compiled by the b4r ide and then load the hex file with a conventional programmer using ISP interface
 
Last edited:

positrom2

Active Member
Licensed User
Longtime User
load the hex file with a conventional programmer using ISP interface
In the deepness of my system-drive I find this hex file after "compile and run":
src.ino.hex
That should be what you are looking for.
You have to "disconnect" logging within the B4R IDE to unlock the com-port from the B4R IDE. Afterwards I can upload the hex file with the Arduino bootloader and it works. Surely also ISP can be used.
"Printing" (Using "Asyncstreams" in the language of B4X) then should also work. I have not tried yet
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Can the serial port that is used to program the arduino be used by the device after it is disconnected from the programming computer?
Yes. You can also prevent the IDE logger from being connected at all by setting the Logs option to B4J Serial Connector or None:

SS-2016-05-05_08.10.25.png


Using the B4J Serial Connector you can automate it: [tool] External Serial Connector
 
Upvote 0

whcir

Member
Licensed User
Longtime User
Yes. You can also prevent the IDE logger from being connected at all by setting the Logs option to B4J Serial Connector or None:

SS-2016-05-05_08.10.25.png


Using the B4J Serial Connector you can automate it: [tool] External Serial Connector


Thanks Erel

Can you tell me what are the optional config parameters in "Initialize2 (BaudRate As ULong, Config As Byte)" As void? I am assuming they are baud, parity and stop bits but how are configured as a byte?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
These are the available configurations:

Name Value
SERIAL_5N1 0x00
SERIAL_6N1 0x02
SERIAL_7N1 0x04
SERIAL_8N1 0x06
SERIAL_5N2 0x08
SERIAL_6N2 0x0A
SERIAL_7N2 0x0C
SERIAL_8N2 0x0E
SERIAL_5E1 0x20
SERIAL_6E1 0x22
SERIAL_7E1 0x24
SERIAL_8E1 0x26
SERIAL_5E2 0x28
SERIAL_6E2 0x2A
SERIAL_7E2 0x2C
SERIAL_8E2 0x2E
SERIAL_5O1 0x30
SERIAL_6O1 0x32
SERIAL_7O1 0x34
SERIAL_8O1 0x36
SERIAL_5O2 0x38
SERIAL_6O2 0x3A
SERIAL_7O2 0x3C
SERIAL_8O2 0x3E

The default value is 0x06.
 
Upvote 0
Top