I wrote the attached program "keyboard.c" which sends an unbuffered keystroke to my Arduino DUE at 28800 baud.
The DUE is programmed with the attached "stepper_test.ino", which is a modification of the code provided by Sparkfun Electronics for the Big Easy stepper motor driver. My understanding is that, if I transmit over the "programming USB port" at 9600 baud, it will reprogram the DUE. However, since I am communicating at 28800 baud, communication should go as programmed.
My understanding is that if there is nothing to send, the request for input from the DUE (dueout in line 72 of the keyboard program) should result in a zero. Instead, I am getting bufr = 'k' (or some other random character). ?? PS Hopefully, someone else will find keyboard.c to be useful. keyboard.c (3.08 KB) stepper_test.ino (5.8 KB)
...if I transmit over the "programming USB port" at 9600 baud, it will reprogram the DUE. However, since I am communicating at 28800 baud, communication should go as programmed.
The DUE has two USB ports: a "programming" port and a "communications" port. My understanding is that if a signal is received by the DUE at 9600 baud, it will reprogram the board. If it is received at some other speed, it goes to the "signal in" port.
ard_newbie: ...if I transmit over the "programming USB port" at 9600 baud, it will reprogram the DUE. However, since I am communicating at 28800 baud, communication should go as programmed.
What does this mean ??
And post your code between code tags <>
ard_newbie: ...if I transmit over the "programming USB port" at 9600 baud, it will reprogram the DUE. However, since I am communicating at 28800 baud, communication should go as programmed.
My understanding is that if a signal is received by the DUE at 9600 baud, it will reprogram the board. If it is received at some other speed, it goes to the "signal in" port.
It is a wrong understanding. When you upload a new sketch into your board, the baud rate is automatically set to 1200 and this triggers an erase of the Flash memory followed by the effective upload of a binary file (your compiled sketch).
To communicate between your PC and the board via the Programming port, you can select one of the available baud rates (better to select the maximum, 250000).
You can communicate between your PC and the board thru the native USB port: select any baud, rate but the final baud rate thru the native USB port ( ~ 849 KBytes/s for a SerialUSB.print() is not related with the selected baud rate (although you have to select one !)
So, if I were to compile the sketch with GCC in lieu of the Arduino compiler, and then copy that file to the DUE board at 1200 baud thru the programming port, that would replace the existing program?
In my sketch on line 24:
Serial.begin(28800);
is ignored for communicating over the USB port?
What speed should I be sending, receiving with from the computer over the USB port?
ard_newbie: My understanding is that if a signal is received by the DUE at 9600 baud, it will reprogram the board. If it is received at some other speed, it goes to the "signal in" port.
It is a wrong understanding. When you upload a new sketch into your board, the baud rate is automatically set to 1200 and this triggers an erase of the Flash memory followed by the effective upload of a binary file (your compiled sketch).
To communicate between your PC and the board via the Programming port, you can select one of the available baud rates (better to select the maximum, 250000).
You can communicate between your PC and the board thru the native USB port: select any baud, rate but the final baud rate thru the native USB port ( ~ 849 KBytes/s for a SerialUSB.print() is not related with the selected baud rate (although you have to select one !)
I used the Arduino IDE (Integrated Development Editor) to compile and upload my sketch, which was successful. The link that you provided is good info. Thank you. It confirms that using some other IDE would require uploading at 1200 baud.
However, that does not address my primary problem which is: Why can't