programming Cyton without RFduino dongle? / our completed SSVEP demo

HaseebHaseeb Lahore
edited September 2019 in Build-it-yourself
I have used the openbci cyton design to make the cyton board. I am planning to use the wifi shield instead of bluetooth dongle. My cyton board doesn't have BTLE module. I have these questions:
1- Since I need pic32mx250f128b microcontroller with chipkit UDB32-MX2-DIP bootloader. Can bootloader hex file be uploaded to microcontroller using FTDI chip or the only way is pickit 3? If yes then what will be the pin connections?
2- According to openbci documentation, bluetooth dongle is needed to upload the firmware. Can wired connections be used to upload the firmware? Like connecting the serial pins through FTDI chip.
3- Or is it possible to upload the bootloader hex file as well as the firmware using pickit 3?

Thanks
«1

Comments

  • Sorry! I should have posted in build-it-yourself category and now it seems I don't have the permissions to move it to the build-it-yourself category.
  • Thanks William!

    I read the discussion. I know that break out pins are available for bootloading of chipkit but it couldn't answer my questions.
  • wjcroftwjcroft Mount Shasta, CA
    I think the safest choice is to use a Pickit 3, but see these search results,


  • It is fine with me to use Pickit 3 but I have a confusion. In the openBCI documentation, it first talks about bootloading the chipkit with Pickit 3 then it talks about uploading the firmware using Bluetooth dongle. Is it possible to upload the firmware too using Pickit 3?
  • wjcroftwjcroft Mount Shasta, CA
    Once the bootloader is in place (via Pickit), you can then upload (without Pickit) through your serial port / FTDI device. The RFduino on the mainboard just connects to the PIC via a serial port.
  • Alright!
    Is it the bootloader that allows to communicate with the chipkit serially?

    I'll go for the FTDI device option.
    What will be the connections? I mean where to connect the Rx and Tx pins of FTDI device on cyton board?
  • wjcroftwjcroft Mount Shasta, CA
    The bootloader firmware on the PIC, receives a serial port stream of data, and installs it into the flash memory. The bootloader itself is never changed.

    See the Cyton schematic for how the Tx Rx pins connect between PIC and RFduino. You would just replace the RFduino with your FTDI Rx Tx pins.

    Let me qualify this by saying that I have not tried this configuration personally. But the PIC bootloader is indeed getting the upload data stream via it's serial port.

    Note that your eliminating the RFduinos may require other changes in the way that OpenBCI_GUI interacts with your Cyton, and how the Wifi Shield figures into all of this. Normally you would not have a hardwired serial connection active to the Cyton, during EEG acquisition, for safety precaution. There are USB isolator devices that may be helpful.

  • Thank you William, I'll look into the cyton schematic.

    Do I need the serial connections after uploading the firmware as you mentioned the way OpenBCI_GUI interacts with cyton? What I was thinking is to upload the firmware using wired connections then make cyton board communicate with OpenBCI_GUI via Wi-Fi shield (while serial connection is removed).
  • wjcroftwjcroft Mount Shasta, CA
    You definitely need that serial connection to use OpenBCI_GUI. I'm not sure of the details on the startup of the Wifi Shield. As you can see here, there is a serial port command to attach the Shield.


    Or change the sample rate, or adjust many of the other Cyton parameters. So I don't believe it is possible to run purely over Wifi. 
  • Got it. Thanks
  • Hi wjcroft! Thanks again. I uploaded the bootloader using pickit 3 and was able to upload the firmware without using bluetooth, by directly connecting the Rx and Tx pins.

    Now I am using the wifi shield. I have got an issue. The OpenBCI_GUI detected the wifi shield but it says no eeg board attached while it was attached actually. I checked all the connections between wifi shield and the cyton board, they were ok. At that time, the serial port was opened. After that I used the serial port and tried to attach the wifi shield using the command but it says wifi shield not attached. What are the possible deductions?
  • wjcroftwjcroft Mount Shasta, CA
    I would suggest checking the source code to see exactly what command sequences are sent upon Wifi Shield startup. 


    Regards,

    William

  • Hi William!

    I checked the OpenBCI_GUI code, it either connects through WIFI or bluetooth not both at a time. I checked the swagger hub that shows meanings of different response codes of WIFI shield. The OpenBCI_GUI on startup reads those codes to know the status. Since I also tried to attach the WIFI shield by sending command through serial port it seems either the WIFI SPI pins are damaged or the Cyton's.

    I want you to please confirm these following things
    1- On startup cyton serial port shows addresses of ads1299 and LIS3DH, does that indicate pic has successfully communicated with these modules through SPI? If this is the case then my WIFI module's SPI pins are damaged.
    2- I communicated through serial pins using USB isolator, I was able to send the commands and read the responses. When I sent the command to start streaming, I started receiving some data not readable. I came to know from your comment that it was binary encoded data that OpenBCI_GUI decodes. OpenBCI_GUI was not able to decode it. Is that because I am not using RFD BLE module? Does BLE module modifies this data to make it decode-able by OpenBCI_GUI? The Cyton SDK thing?
    3- Can I use NodeMCU instead to WIFI shield?, just for checking purposes because I think there is problem with my WIFI module's SPI pins.

    Thanks
    Haseeb
  • I checked OpenBCI_32bit_Library and found that it prints addresses of ads1299 and LIS3DH after communicating with them using SPI.
  • There was a problem with my spi pins of wifi module. It is working now.

    I want to summarize this thread that you can run cyton board with wifi shield without using bluetooth dongle or bluetooth module on the cyton board. You just need one time connection to upload the firmware to cyton board for that purpose you can have wired connections to Rx and Tx pins which are pins 3 and 4 respectively when bluetooth module is not present on cyton board. You do not need wired connection while streaming.
  • wjcroftwjcroft Mount Shasta, CA
    Thanks. Can you start Wifi streaming from the GUI, with no serial port connection at all? How does the Cyton know to monitor Wifi for the connection? Can all that be setup over Wifi? Can you change Cyton GUI settings, without the serial port access to the SDK serial commands? Etc.


    Are all the above commands accessible via Wifi connected GUI?


  • Yes, it is possible over wifi. When I started the gui through processing, I was able to see the commands in console that were sent over wifi for channel settings. The SDK commands can be sent through bluetooth or wifi. See the SRB1_Test on the link you just mentioned. This line was written over there "If not streaming, NOTE: WiFi shield always sends the following responses without $$$"
  • Hi. After assembling the board, without firmware. If the supply voltage is applied, should the blue LED D1 be on?
  • edited March 2019
    With help from @Haseeb, I was able to get my Cyton and WiFi Shield DIY boards up and running without the RFDuino ICs.

    This is the procedure that worked for me (running OS X 10.13.6) :
    • Soldered components and connectors to WiFi Shield and Cyton (without RFDuino IC) PCBs.
    • Used a PICKit3 to program the bootloader hex onto the PIC32 with MPLAB IPE (v5.15) via the headers.
    • Used a FTDI adapter (baud rate: 115,200 b/s) to program the Cyton firmware onto the PIC32 with Arduino IDE (v1.8.9) by temporarily soldering to pads 3 (RXD) and 4 (TXD) of where the RFDuino would have been.
    • Used a FTDI adapter (baud rate: 115,200 b/s) to program the WiFi Shield "BoardWithWifi" firmware onto the ESP8266 with Terminal via esptool.
    • Connected WiFi Shield to 5V external power (SW4: on), turned it on, and changed its settings to connect to my home wireless network.
    • Turned off the WiFi Shield and stack-connected it onto the Cyton board.
    • Connected WiFi Shield to 5V external power (SW4: on), turned it on, and streamed data via OpenBCI GUI.
    With the WiFi Shield mounted on the Cyton board and the WiFi Shield connected to external power (SW4: on), both boards are powered and all blue LEDs (WiFi Shield: D2, D3, D4 and Cyton: D1) are steady-on. Using a 5V supply, the two boards are drawing a steady 120 mA.

    I have completed printing and putting my headset together, just waiting on my electrodes to arrive.

    Here is a link to an OpenBCI GUI screen-capture of my electrode-less setup.



  • Congratulations @alwayswearshats!
    Keep it up.
  • I was able to make this project with the help of my team using cyton board and wifi shield:

    Thanks to OpenBCI.

    Regards
    Haseeb

  • wjcroftwjcroft Mount Shasta, CA

    Haseeb, congratulations. Your video is also impressive. Consider posting a description of your project overview, and the video link on the Community site,

    https://docs.openbci.com/docs/01GettingStarted/03-Community/Community

    Best regards, William

  • retiututretiutut Louisiana, USA

    @Haseeb Really cool! I agree with William that this is definitely Community post worthy! Great work!

  • Thanks @wjcroft and @retiutut. I have created a post in community forum regarding this demo.

  • wjcroftwjcroft Mount Shasta, CA

    Haseeb, thanks much. Your post is now live,

    https://openbci.com/community/

  • edited September 2020

    @alwayswearshats said:
    With help from @Haseeb, I was able to get my Cyton and WiFi Shield DIY boards up and running without the RFDuino ICs.

    This is the procedure that worked for me (running OS X 10.13.6) :

    • Soldered components and connectors to WiFi Shield and Cyton (without RFDuino IC) PCBs.
    • Used a PICKit3 to program the bootloader hex onto the PIC32 with MPLAB IPE (v5.15) via the headers.
    • Used a FTDI adapter (baud rate: 115,200 b/s) to program the Cyton firmware onto the PIC32 with Arduino IDE (v1.8.9) by temporarily soldering to pads 3 (RXD) and 4 (TXD) of where the RFDuino would have been.
    • Used a FTDI adapter (baud rate: 115,200 b/s) to program the WiFi Shield "BoardWithWifi" firmware onto the ESP8266 with Terminal via esptool.
    • Connected WiFi Shield to 5V external power (SW4: on), turned it on, and changed its settings to connect to my home wireless network.
    • Turned off the WiFi Shield and stack-connected it onto the Cyton board.
    • Connected WiFi Shield to 5V external power (SW4: on), turned it on, and streamed data via OpenBCI GUI.

    With the WiFi Shield mounted on the Cyton board and the WiFi Shield connected to external power (SW4: on), both boards are powered and all blue LEDs (WiFi Shield: D2, D3, D4 and Cyton: D1) are steady-on. Using a 5V supply, the two boards are drawing a steady 120 mA.

    I have completed printing and putting my headset together, just waiting on my electrodes to arrive.

    Here is a link to an OpenBCI GUI screen-capture of my electrode-less setup.

    Dear Haseb
    i want to build openbci v3-32bit
    but idont want to use RFD22 module because of discount,now i want to use just wifi shild board,
    would you please guide me,
    i program "DefaultWifiShield.2.0.5.bin" to esp-12e module with a usb2serial adaptor and esptools,
    now i want to program pic32, which program i program ? "BoardWithWifi" or "defaultBoard"?

    another things:you say
    Used a FTDI adapter (baud rate: 115,200 b/s) to program the WiFi Shield "BoardWithWifi" firmware onto the ESP8266 with Terminal via esptool. why we program "BoardWithWifi" to ESP8266 ??

  • @haseeb and @wjcroft , sorry for necro'ing, any more info on uploading the firmware using ftdi (pinouts or libraries) ? i've flashed the bootloader with pickit, but it seems just connecting the ftdi to Rx Tx lead me to errors, the arduino ide seems not able to found any target, any thoughts?

  • Please double check that you're following the Bluetooth based firmware uploading guide with only difference of direct rx/tx pin connections of ftdi with pic controller's tx/rx pins and the ground pin obviously.

  • hanif777hanif777 Indonesia
    edited September 2020

    Alright i did:
    1. Updated arduino ide (1.8.13), updated FTDI Driver
    2. Flashed UDB32_MX2_DIP.hex using Chipkit (Blue Led Keeps Blinking after that) through MPLab IPE 4.15
    3. Installed the 32Bit_Library, 32Bit_SD, Wifi_Master, and Chipkit Core Firmware
    4. Open the DefaultBoard.ino, make sure the port is correct and board is OpenBCI 32
    5. Connect the PIC Rx/Tx that was connected to RFDuino to the FTDI front RX/TX, and connect both ground pins
    6. The Led is Blinking (indicating bootload mode active) and i try to compile & upload using Arduino IDE
    Still got the error "no target found" and "An error occurred while uploading the sketch"
    Oh and what are the indication that the firmware is working properly?

Sign In or Register to comment.