Burning Firmware on Arduino

MCU, Firmware, etc.
Rahul
Posts: 6
Joined: Mon Feb 29, 2016 3:02 am

Burning Firmware on Arduino

Postby Rahul » Mon Feb 29, 2016 9:43 am

Hello there!
I am interested in using the firmware provided to burn it on an Arduino nano and then interface it with an intel edison to leverage the bluetooth connection. Is this possible?

Or is there simply a javascript/python library to set up third party mcu such as Edison with the OpenSignal software??
Because when I pair edison with my mac, Opensignal still cannot detect any devices since my mcu is not running Bitalino Firmware.
thank you for the support and sorry for beginner questions

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

Re: Burning Firmware on Arduino

Postby BITalino » Mon Feb 29, 2016 10:32 am

Hi Rahul,

The BITalino firmware and programming instructions are available on GitHub at:
https://github.com/BITalinoWorld/firmware-bitalino

In principle it should work with any ATMega328, but in order for it to be compatible with OpenSignals you'll either have to setup Bluetooth module to be named BITalino and for 115200kbps baud rate or dig through the openSignals code to adapt it to work with a different communication channel or settings.

You can also look at our OpenSignals bare bone as a starting point (easier to adapt):
https://github.com/BITalinoWorld/python-serverbit

Best regards,
The BITalino Team

Rahul
Posts: 6
Joined: Mon Feb 29, 2016 3:02 am

Re: Burning Firmware on Arduino

Postby Rahul » Wed Apr 06, 2016 10:24 am

Thank you for the support!
It was very helpful.
So basically i burn the firmware on the arduino nano. will it work directly when connected to computer via usb or should I use an FTDI adapter?
I do not have a bluetooth module. I am a student experimenting with BITalino. by the way, great job!!! I want to burn the firmware on Arduino Nano, connect some sensors to it and try to get the data real-time on a computer. Thank you

cazevedo
Posts: 18
Joined: Tue Feb 25, 2014 2:17 pm

Re: Burning Firmware on Arduino

Postby cazevedo » Wed Apr 06, 2016 2:02 pm

Hi Rahul,

You can in fact flash the Arduino MCU with BiTalino firmware but you must change the source code to match the Arduino clock frequency and pinouts. For that you cannot use the Arduino IDE, you need to use the avr gcc toolchain and the avr tools.

Best regards,
Carlos Azevedo

Rahul
Posts: 6
Joined: Mon Feb 29, 2016 3:02 am

Re: Burning Firmware on Arduino

Postby Rahul » Wed Apr 06, 2016 3:02 pm

Oh I thought i would just burn the firmware! My bad, I am a beginner ,sorry! I guess I have to look into that. Thank you
maybe you mean change the pin assignments in the main.c file?

cazevedo
Posts: 18
Joined: Tue Feb 25, 2014 2:17 pm

Re: Burning Firmware on Arduino

Postby cazevedo » Wed Apr 06, 2016 3:29 pm

Yes that is right. For example if you want to drive the Arduino board LED or an external LED you need to change the pin that it is being used in the BiTalino firmware since the LED on the BiTalino is connected to a different pin. Another example is if you want to connect an analog sensor you need to make sure that you have one of the used ADC pins are available (C0-C3, C6 or C7) otherwise you need to change the firmware to use different pins. In the pios.h you have a list with the pinout assignment. You should also look into the rest of the code and check how these pins are being used so you you can check that the hardware that you are using will have the desired behavior.

Best regards,
Carlos Azevedo

Rahul
Posts: 6
Joined: Mon Feb 29, 2016 3:02 am

Re: Burning Firmware on Arduino

Postby Rahul » Thu Apr 07, 2016 2:21 am

Thank you for going out of your way and providing such a detailed explanation! This makes me respect the BITalino community even more! I will experiment with it. Again, Im a student so maybe Ill we back with more questions! Sorry in advance. Thanks again

Rahul
Posts: 6
Joined: Mon Feb 29, 2016 3:02 am

Re: Burning Firmware on Arduino

Postby Rahul » Fri Apr 08, 2016 1:11 pm

Hey there! I want to confirm some things before proceeding:
1. the arduino nano clock speed is 16MHz, which I assume is similar to the preset firmware?
2. the use case scenario is like this: burn firmware on nano then connect tx/rx UART to another wifi SoC ESP8266 to transfer the acquired data wirelessly.
The ESP8266 will be programmed using the provided arduino API(bitalino.ino and test.ino sketches). Hope this is possible!
3. Can I use an FTDI USB-TTL to connect the Nano(running the bitalino firmware) directly to computer and then use Python Barebone sketch(after modifying /dev..) to acquire live data?
4. Say I do not use bitalino sensors, can I connect electrodes directly to assigned pins and acquire raw data? I assume this data will have a high noise ratio--then use DSP to filter the signal?


I realise what I want to do sounds counterproductive, but I am using this method to showcase the use of BITalino. Thanks for the help

cazevedo
Posts: 18
Joined: Tue Feb 25, 2014 2:17 pm

Re: Burning Firmware on Arduino

Postby cazevedo » Fri Apr 08, 2016 1:57 pm

Hi Rahul,

1. The BiTalino clock speed is 8MHz so you will need to change that on the source code.
2. I never worked with the WiFi SoC ESP8266, but in order to start/stop an acquisition and choose the the acquiring frequency you need to send specific commands to the microcontroller via UART.
3. I never used Python Barebone sketch, but if you connect the FTDI to the UART pins instead of the ESP8266 you will be able communicate with the microcontroller and acquire live data directly to the PC.
4. Depends what signal you want to measure but for example if you want to measure an EMG signal the range is more or less -2mV to 2mV and the Arduino doesn't have enough resolution for that so you would need a sensor.

You can find on the following link the protocol specification for the commands and for the streamed data:
http://bitalino.com/datasheets/MCU_Block_Datasheet.pdf

Best regards,
Carlos Azevedo


Return to “Microcontroller”