<< return to Pixycam.com

How to access to serial port (UART) on 10-pin header?

I want to play with the firmware on the Pixy (v1), so I was hoping to be able to print to the UART port that is connected to the 10-pin header. I don’t have a schematic so I can’t be sure what I’m really accessing, but I’ve tried _DBG(), printf() and lpc_printf() (and I also set the “Data out port” text box to ‘2’ under the “Interfaces” tab of PixyMon.
I have it set to 19200, and I’ve connected the Tx/Rx and GND pins to a USB-to-serial device on my PC. Tried swapping Tx/Rx, changing baud rates, etc… but have had no luck getting anything to print out. Am I missing something?
Tx

Hello,
Check out uart.cpp:

You need to set the pinmux to the right values for the UART signals to be present on the I/O port. Look for the scu_pinmux calls.

Hope this helps!

Edward

Hmmm… Interesting, thanks for the quick response.
I see that Uart.open() gets called only if the ser_loadParams() detects that the interface is configured to SER_INTERFACE_UART. After seeing that I believe there is an inconsistency between the hint in the PixyMon GUI for “Data out port” in the Interface tab…
It shows:
0=SPI; 1=I2C; 2=UART; etc…
I also noticed that SER_INTERFACE_UART is defined as ‘3’.
So, I went to PixyMon and set “Data out port” to ‘3’, and bingo, I see the serial output on the UART pins.

Am I going cross-eyed or is this a bug in PixyMon?
Thanks,

One other thing I realized (after I got a copy of the schematic), the UART that is used by DBG() is connected to J7 on the PixyCam board. Moving my serial port connections to those RX/TX connections gave me the output I expected from DBG().
So, at this point, I guess the only open issue is the GUI… Is what I mentioned in my previous reply a bug?

It’s a really old version of PIxymon you’re referring to. (Are you using IR-lock?) It’s possible that the number is wrong somehow.

Edward

I’m building it from github. The about dialog box says 2.0.10.
I just followed the instructions in the docs for “Installing PixyMon on Linux”.
Is there a different build?
(thanks much for your replies)

I should have said it’s an old version of the firmware. What version of the firmware are you using?

Same thing… its whatever is on github now.

Latest version is 2.0.19 for original Pixy (v1), linked here: https://pixycam.com/downloads-pixy1/

Thanks, but I’m building it from the source on github.
Is that not the latest version?

Sorry, I think there’s some confusion. It’s not possible to build the firmware from source. We have the firmware .hex files on our Github. Perhaps you mean you’re building PixyMon from source?

Please note that there are two separate repos on Github, one for original Pixy, and one for Pixy2. Since you’re using v1, you want the pixy repo, and this firmware file: https://github.com/charmedlabs/pixy/blob/master/releases/firmware_general/pixy_firmware-2.0.19-general.hex

Hope this helps!

Cheers,
Jesse

Huh?
What’s this?
https://github.com/charmedlabs/pixy/tree/master/src/device.
Looks like firmware to me…
https://docs.pixycam.com/wiki/doku.php?id=wiki:v1:building_pixy_firmware

Hello,
I think there’s confusion on our end. It’s true that you can build the firmware.

Sorry – your inquiry has sort of been buried. Assuming you are building with the latest source for Pixymon and firmware for Pixy1 (it appears so), what would you like help with?

Edward

Hi,
I just started digging into this 'cause its really impressive what you folks have done with this small memory footprint. It also gives me a good excuse to play with a dual-core microcontroller. If you guys have any documentation on the firmware design, I’d love to get my hands on it.

Anyway, regarding this post, I’m really [almost] good to go…

I wanted to be able to build/install the firmware and simply add printf statements (since I don’t have any other debugger) to trace just a bit. Since my initial post, I received a copy of the schematic and that revealed the value of J7 as the debug UART. I also made a few changes to the makefile_alt files so that I could build without using the LPCXpresso GUI. As of now I still need the toolset, but I don’t need the GUI (call me an old-dog, but I still like cscope and ctags).
So, I guess the only [trivial] open issue for me is to understand why the GUI seems to be inconsistent with the firmware (both of which are built from the latest github clone). Refer to my post from Oct 29.
Thanks much for replying…
God bless!
Ed

Hi Ed,
Glad to see you’re getting things figured out :slight_smile: I’m not seeing the same hint you mention in the source code:

see line 232.

The hint you describe appears to be from old code. I’m not sure why though.

Edward