Interface with MCU using FTDI UART

Bluetooth, USB, UART, Storage, etc.
BITalino
Site Admin
Posts: 567
Joined: Tue Aug 27, 2013 3:47 pm

Re: Interface with MCU using FTDI UART

Postby BITalino » Mon Nov 21, 2016 2:58 pm

Hi,

We've recently detected an issue related with the flow control.

Can you confirm that you are using the latest version available at:
https://github.com/BITalinoWorld/cpp-api

Best regards,
The BITalino Team

ole.traupe
Posts: 43
Joined: Tue Jun 17, 2014 10:50 am

Re: Interface with MCU using FTDI UART

Postby ole.traupe » Mon Nov 21, 2016 4:24 pm

Thanks for getting back to me. I was recently (here in this thread) pointed towards flow control needing to be activated from the software side. Your team was so kind to provide the correct settings via an API update. I downloaded that update on Nov 14. So yes, I believe I am using the latest API including the changes in flow control. The bitalino.cpp file is marked as being update "a month ago". Before using this update I wasn't able to read out the firmware version via FTDI.

I currently believe communicating via FTDI takes a bit longer than via Bluetooth, so that querying chunks of 100 samples (at 1000 Hz sampling rate) creates an accumulating delay which finally results in buffer overflow and data loss.

ole.traupe
Posts: 43
Joined: Tue Jun 17, 2014 10:50 am

Re: Interface with MCU using FTDI UART

Postby ole.traupe » Mon Nov 21, 2016 4:40 pm

Dear BITalino Team,

Thanks a lot for your great assistance! Seems it is working fine now, here a pic including the beautiful 3D printed case you offer:
Image

One of the reasons behind taking a tethered approach for me is that I am planning an experiment where 4-5 BITalinos will run concurrently on as many mobile PCs. So it is paramount that a PC is not accidentally connecting to the wrong board. But an additional benefit is that there cannot be any missing samples due to BT transmission issues (signal occlusion by the torso, e.g.) if the software is working as expected.

BITalino
Site Admin
Posts: 567
Joined: Tue Aug 27, 2013 3:47 pm

Re: Interface with MCU using FTDI UART

Postby BITalino » Mon Nov 21, 2016 7:42 pm

Hi there,

Its our pleasure to support... we'll try to replicate your setup over the coming weeks to check if there is anything else that can be optimised.

Thanks for the picture and for the additional details; your setup looks really nice. If you happen to write a technical paper or a tutorial about it, do let us know as it may be useful for other users as well.

As you've probably seen, typically we share this type of resources on our website (with all due credits) so that other users can more easily find answers to help them achieve their desired goals:
http://bitalino.com/index.php/learn/tutorials
http://bitalino.com/index.php/community/projects
http://bitalino.com/index.php/community/publications

We're glad you liked the 3D printed case... its the result of a very successful collaboration with the amazing team at BEE Very Creative: https://beeverycreative.com

Best regards,
The BITalino Team

ole.traupe
Posts: 43
Joined: Tue Jun 17, 2014 10:50 am

Re: Interface with MCU using FTDI UART

Postby ole.traupe » Tue Nov 22, 2016 9:11 am

Of course, I'll keep you updated about any additional output from this project.

Thanks again!
Ole

ole.traupe
Posts: 43
Joined: Tue Jun 17, 2014 10:50 am

Re: Interface with MCU using FTDI UART

Postby ole.traupe » Wed Nov 23, 2016 11:57 am

As you mentioned the battery aux analog input... can you perhaps give some more detail on it? I assume it is analog value no. 7? It seems to be oscillating in the very same way as the sequence marker...

Code: Select all

0 : 1 1 0 0 ; 0 0 0 0 0 0 257 1 0
4 : 1 1 0 0 ; 0 0 0 0 0 0 261 1 0
8 : 1 1 0 0 ; 0 0 0 0 0 0 265 1 0
12 : 1 1 0 0 ; 0 0 0 0 0 0 269 1 0
0 : 1 1 0 0 ; 0 0 0 0 0 0 257 1 0
4 : 1 1 0 0 ; 0 0 0 0 0 0 261 1 0
8 : 1 1 0 0 ; 0 0 0 0 0 0 265 1 0
12 : 1 1 0 0 ; 0 0 0 0 0 0 269 1 0
0 : 1 1 0 0 ; 0 0 0 0 0 0 257 1 0
4 : 1 1 0 0 ; 0 0 0 0 0 0 261 1 0
8 : 1 1 0 0 ; 0 0 0 0 0 0 265 1 0
12 : 1 1 0 0 ; 0 0 0 0 0 0 269 1 0
0 : 1 1 0 0 ; 0 0 0 0 0 0 257 1 0
4 : 1 1 0 0 ; 0 0 0 0 0 0 261 1 0
8 : 1 1 0 0 ; 0 0 0 0 0 0 265 1 0
12 : 1 1 0 0 ; 0 0 0 0 0 0 269 1 0
0 : 1 1 0 0 ; 0 0 0 0 0 0 257 1 0
4 : 1 1 0 0 ; 0 0 0 0 0 0 261 1 0
8 : 1 1 0 0 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 0 0 0 0 0 0 261 1 0
8 : 1 1 0 0 ; 0 0 0 0 0 0 265 1 0
12 : 1 1 0 0 ; 0 0 0 0 0 0 269 1 0
0 : 1 1 0 0 ; 0 0 0 0 0 0 257 1 0
4 : 1 1 0 0 ; 0 0 0 0 0 0 261 1 0
8 : 1 1 0 0 ; 0 0 0 0 0 0 265 1 0
12 : 1 1 0 0 ; 0 0 0 0 0 0 269 1 0
0 : 1 1 0 0 ; 0 0 0 0 0 0 257 1 0
4 : 1 1 0 0 ; 0 0 0 0 0 0 261 1 0
8 : 1 1 0 0 ; 0 0 0 0 0 0 265 1 0
12 : 1 1 0 0 ; 0 0 0 0 0 0 269 1 0
0 : 1 1 0 0 ; 0 0 0 0 0 0 257 1 0
4 : 1 1 0 0 ; 0 0 0 0 0 0 261 1 0
8 : 1 1 0 0 ; 0 0 0 0 0 0 265 1 0
12 : 1 1 0 0 ; 0 0 0 0 0 0 269 1 0
0 : 1 1 0 0 ; 0 0 0 0 0 0 257 1 0
4 : 1 1 0 0 ; 0 0 0 0 0 0 261 1 0
8 : 1 1 0 0 ; 0 0 0 0 0 0 265 1 0

BITalino
Site Admin
Posts: 567
Joined: Tue Aug 27, 2013 3:47 pm

Re: Interface with MCU using FTDI UART

Postby BITalino » Wed Nov 23, 2016 1:04 pm

Hi there,

On the new model, the battery level is no longer sent along with the data frames. Now you can retrieve it using the newly-introduced state() method.

Nevertheless, if you'd like to achieve the behavior you can free one of the analog inputs (e.g LUX) and wire the ABAT pin on the PWR block to the freed channel.

Best regards,
The BITalino Team

ole.traupe
Posts: 43
Joined: Tue Jun 17, 2014 10:50 am

Re: Interface with MCU using FTDI UART

Postby ole.traupe » Wed Nov 23, 2016 1:12 pm

Ok. So what I am seeing on 'f.analog[6]' is the CRC?

And what is sent as 'f.analog[7]' and 'f.analog[8]'? Seems that there are 9 unique analog values in a data package with 'f.analog[9-17]' (and so on) repeating this structure (probably due to data chunking).
Last edited by ole.traupe on Wed Nov 23, 2016 1:29 pm, edited 1 time in total.

BITalino
Site Admin
Posts: 567
Joined: Tue Aug 27, 2013 3:47 pm

Re: Interface with MCU using FTDI UART

Postby BITalino » Wed Nov 23, 2016 1:28 pm

f.analog[] should have a maximum length of 6 elements (one per analog input).

The CRC is not made available in the Frame structure.

The state() command cannot be used while the device is in acquisition... it'll throw an exception.

Best regards,
The BITalino Team

ole.traupe
Posts: 43
Joined: Tue Jun 17, 2014 10:50 am

Re: Interface with MCU using FTDI UART

Postby ole.traupe » Wed Nov 23, 2016 1:31 pm

Sorry for editing while you are responding. You were typically not that swift in the recent past. *tongue-in-cheek*


Return to “I/O”




cron