Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serial Port setup (45k50)
06-10-2014, 09:50 AM, (This post was last modified: 06-10-2014, 09:53 AM by GastonLagaffe.)
Serial Port setup (45k50)
as I try to do get used to the pinguino step by step, I thought I try to talk to it using the serial port. I identified the pins for TX/RX (25,26) and connected them crossed to a RS232/USB adapter (FOCA from itead). I then used a simple code to write to the serial port:
void setup() {
   //run once:

void loop() {
   //run repeatedly:
I see on the RX/TX leds of the FOCA that I get something on the RX line of the foca ever 500 ms. Typing in the serial terminal program lights the TX line. So all looks ok. Unfortunately I do not see anything on the serial terminal.
The port settings are:
Baud: 9600
data: 8-bit
parity: none
stop: 1-bit
flow control: none (also tried xon/xoff and hardware without success)
As I see the RX line pulsing with the Serial.printf command, it must be something simple I am overlooking

Ciao, Mathias
(Sorry for the perhaps stupid questions but I am absolutely fresh on the Pinguino)
PIC18F45k50 kit, Windows7, pinguino 10.4 and 11.x
06-10-2014, 11:48 AM,
RE: Serial Port setup (45k50)
(06-10-2014, 09:50 AM)GastonLagaffe Wrote: Salut,
I tried your example on X.4 and V11 and it works.
The only difference I use a true RS232 line with an adapter 5V (made with 2 transistors).
Try to switch between RX and TX on your USB adapter.
Bye André
06-10-2014, 12:52 PM,
RE: Serial Port setup (45k50)
(06-10-2014, 11:48 AM)gtcbreizh Wrote: Salut André,

if I swap the RS232 adapter and it works now! Looks like a hardware problem with that adpater.
Tested speed up to 921600 baud ... 8 times faster than arduino Wink

Tanks for the fast reply,
06-10-2014, 05:05 PM, (This post was last modified: 06-10-2014, 05:05 PM by GastonLagaffe.)
RE: Serial Port setup (45k50)
Salut André,

just that you get an impression what I am trying to achieve:
I have a windows application that acts like a dashboard for microcotrollers. I started this with arduinos and now want to use it with the pinguino. Attached is a screenshot of the working bink demo. It shows the identified board on the right side and the running sketch on the bottom left. The demo lets a RGB LED blink in the different colors.

The dashboard provides buttons, output labels, sliders, radio buttons, checkboxes, comboboxes and the possibility to chart data linear, polar and as histograms.

I will keep you posted with the progress

Ciao Mathias
PS: the dashboard currently runs on windows only (.net) but the wx_python version is on its way

Attached Files Thumbnail(s)
06-10-2014, 08:04 PM,
RE: Serial Port setup (45k50)
Salut Mathias,
Is it possible to see more in the Arduino context ? I own a Duemilanove ATmega328 which I appreciate very much.
From my side I worked with Python, PySide and a 47J53 using some elements in Arduino firmata. See attached capture

Attached Files Thumbnail(s)
07-10-2014, 10:11 AM,
RE: Serial Port setup (45k50)
(06-10-2014, 08:04 PM)gtcbreizh Wrote: Salut André,

the communication protocol is a very simple one and not limited to the arduino. Here the code of a simple histogram demo:

void setup() {
// start the serial interface
while (!Serial) {
  ; // wait for serial port to connect. Needed for Leonardo only
Serial.println(">BRD.NANO<"); // identify yourself with the right board (UNO, LEONARDO, MEGA, NANO, P45K50)
Serial.println(">IFO.Histogram Demo Sketch 1.0.0<"); // Who are we
Serial.println(">TTL1Dashboard Demo - Histogram Test<"); // Demo Title to be displayed
Serial.println(">HTM001.0000.1200<"); // Histogram x-axis minimum and maximum
Serial.println(">HTZ001<"); // set Histrogram data to zero

void loop() {
// put your main code here, to run repeatedly:
int val;
val = analogRead(1);
This is a non-interactive demo, so the arduino sends the setup information to the dashboard to identify itself and the sketch name, then requests a title on the first screen and initializes the histogram. In the loop, it simply sends the data (HTV=HisTogram Value). The dots are only there for the human user to make the protocol readable. I know this is a waste of bytes but I find this nicer for debugging.
The outcome is attached as well as other screenshots. I am currently writing the documentation but this is time consuming ...
The histogram demo displays static noise on A1. The second demo shows control items of an interactive demo, the third shows the timeline plot of up to 6 sources plus the possibility to send time stamps and the last one shows polar data.


Attached Files Thumbnail(s)

Forum Jump:

Users browsing this thread: 1 Guest(s)