<< return to Pixycam.com

Using the DAC (pin 3)

Hi.
I am using a Pixy to follow a laser pointer around. I can create the color signature for the laser dot, as well as other objects. However, when I attempt to get analog positional data out, I see nothing. I am probing pin 3 with a scope, and probing pin 1 with a multi-meter (which I read should be a high signal when the Pixy is detecting a signature). I set the interface in Pixymon to 4 (for DAC y-position out), yet I receive no signal from the pins. I am using the older version of Pixymon (0.1.49), and I have uploaded the firmware (0.1.44). I was asked not to use the beta version if I have the choice.
Any ideas why I am not getting feedback from the pins? Any help is appreciated!
-Justin Waggoner

Update. Apparently the Electronics god hates me because all I do is fiddle with the connections and reopen my serial port a couple times and I will randomly get data out. Analog out is working (sometimes…) but only goes between about 1V when it should be 3.3V (if I read instructions correctly). Using UART instead (also randomly getting data out) I am not getting the “correct data.” The Pixy Serial Protocol page on this site says I should expect 6 16-bit words per data transaction (one transaction every 20ms). Will the first word always be the sync word (0xaa55)? Because that is not what I am seeing consistently. I worry this may mean that my analog data out is also incorrect.

Hi Justin,

Sorry for your troubles. What are you using to communicate with Pixy? An Arduino?

Have you gone through “this”:http://cmucam.org/projects/cmucam5/wiki/My_Arduino_isn’t_receiving_data_from_Pixy troubleshooting guide? Let me know how it goes.

Thanks!

Scott

Hey Scott thanks for the reply.
I am using windows xp to communicate with the pixy. I have the UART pin on the Pixy connected to a Paralax prototype board which converts the data transfer from UART to USB via a converter. We can output data using a serial port program that I’m guessing came with the Paralax board. We do not plan to use an Arduino with the Pixy.
When using Pixymon, I set the baudrate to the same rate that I use in the serial port program to sync everything up. However, even at many different baudrates I find that the data from pixy is coming too fast or something, and will transfer new data in the middle of old data being transfered. Your site mentions that this may happen when using UART. Is there sure fire way to have the data come out consistently and the right rate so no overlap occurs?
Sorry if my message is confusing at all. I’m learning some of these terms as we go along.

  • Justin

Justin,
I have done some programming with the Pixy and the Parallax Propeller (Quickstart Board and ActivityBot). The first link

[[http://forums.parallax.com/showthread.php/155501-Pixy-for-Propeller]]

starting with post 11 explains what I have done with both Pixy mode 3 (DAC x-position) and Pixy mode 2 UART.

I’ve tried both Forth and C. The version of forth I used (pfth) was not very fast and I had limited success with it. I had much more success with C. Since the Pixy transfers data at a fixed rate, I found that increasing the UART baud rate when only defining one color and tracking one object can result in one data set followed by a lot of zeros until the next frame starts. You can see this using the program in post 22.

I also wrote a program for Pixy using BlockyProp that is being developed in:

[[http://forums.parallax.com/showthread.php/155208-Open-Propeller-Project-5-BlocklyProp?p=1276778&highlight=blocky#post1276778]]

in posts 141 and 144.

The last thing I did was try to write a program to have the ActivityBot track and move to a red laser pointer spot. That’s in post 26 of the first link. However, I found that at a distance greater than about 1-foot, the laser spot was too small to be reliably tracked by the Pixy. Using a larger object (red) the ActivityBot did track and move directly to the red object.

I hope this helps, and I also hope that I did not violate any policy by including the links.

Tom

Thanks! Ill give a try to increasing the baud rate. I guess I figured there was a threshold baud rate for which the pixy would give consistent data, one transaction after the other. But if it exists, I suppose I’ll find it.

Justin,
If you are using the propeller, I recommend trying the program in post 22 noted above. There are a number of
parameters in that program that are documented, and will let you experiment.

One other thing – I found that I did not get good results with the UART when I had Pixymon running and displaying the objects and signature boxes. I had to exit pixymon.
Tom

Im just plugging it into the computer. No servos are being used to move the camera around.

As far as the UART issue goes, i’ve noticed that too. When I have my serial port terminal open at the same time as the Pixymon program, I get bad or no data. It’s something to do with the computer mixing up the ports or something. When I closed Pixymon it worked fine.

Thanks for the tips and keep on tinkering!

Justin

Justin,
The program in Post 22 of the first link doesn’t use the servo (the BlockyProp program in the second link uses servos.) It just receives the data from pixy through the UART and prints it out. Post 22 does the following with the pixy connected to a propeller:

This program prints out the average value of x for a chosen signature

  1. Collects data from Pixy (LSB, MSB)
  2. Discards values before first sync word.
  3. Calculates and saves pixy words
  4. Checks ckecksum
  5. Indexs blocks by signature number
  6. Gets x-position for selected signature and averages it.

Uses SimpleIDE and C for the propeller.
Run with terminal.
This version only prints out the data and average value of x, y, width, or height
for the selected signature to show how quickly it runs.
There are 4 parameters that can be changed (kk, zz, dd, pxi) to change:
kk = the color signature of interest,
zz = the number of data sets,
dd = the delay between data sets, and
pxi = the parameter to be printed (x, y, w, or h).
Uncomment other print words to see intermediate steps including:
All the pixy words in one column that can be cut and pasted into excel.
The number of blocks collected.
The number of blocks of each signature value
The indices of PV[] that contain the signature number
The order of Pixy words in each block is:
43605 (sync), checksum (sum of next 5 words), signature # (1 - 7), x-position of centroid, y-position, width, height.
2 sync words in succession mean start of new frame.

Connect Pixy pin 1 to Propeller pin 8 and pixy pin 4 to propeller pin 9.
Set Pixy to 19200 baud

I kept the pixy connected to my Windows XP computer using the USB port, but exited Pixymon after I had ‘taught’ pixy the color signatures I wanted.

SimpleIDE (which includes the propeller C compiler) and the C libraries can be gotten from:

[[http://learn.parallax.com/propellerc]]

Tom

I forgot to add that Pixy pin 6 (ground) is connected to the propeller ground.

Tom