Author Topic: Uart as input  (Read 12795 times)

jpilarski

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Uart as input
« on: January 26, 2020, 01:33:39 AM »
I would like to use a separate microcontroller which would be running an interactive program and sending commands using the suggested format s=1,1,1,1,1,1. However I don't plan on having the lasershark plugged into a computer. Does the lasershark have to be plugged into usb or does the firmware automatically respond to input over Uart in this format. As an alternate would the debug port be a better option to send commands to the lasershark.

Macpod

  • Administrator
  • Full Member
  • *****
  • Posts: 179
  • Karma: +3/-0
    • View Profile
Re: Uart as input
« Reply #1 on: January 26, 2020, 04:50:06 PM »
Hi jpilarski,

The LaserShark was designed to be controller via USB only. I broke out the I2C, SPI, and UART pins of the micro-controller for the convenience of those who may want to write their own LaserShark firmware for custom applications. There is no code written to support these.

The textual protocol you reference in software is converted to another binary format before being sent to the LaserShark via USB. I'm using bulk and/or isochronous with a custom interface because:
1. It allows more data to be sent with less overhead compared to modeling the device as a serial port.
2. For safety reasons. Lots of software "poke" at connected serial ports (i.e. Ubuntu's Modem Manager) to see if there are known peripherals attached. If this software inadvertently triggers a valid command this could be dangerous.

Have you considered using a Raspberry Pi to control your LaserShark? You could run the LaserShark host software on it and it isn't very large/expensive.

jpilarski

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Uart as input
« Reply #2 on: January 26, 2020, 07:30:55 PM »
Thanks for the info and I figured as much but just thought I'd ask to make sure. I will definitely do as you suggest and incorporate the raspberry pi for any real time interactions with the lasershark.