Shop OBEX P1 Docs P2 Docs Learn Events
Trying to get camera working with my propeller setup, need some input — Parallax Forums

Trying to get camera working with my propeller setup, need some input

charleyshfcharleyshf Posts: 165
edited 2010-05-12 18:35 in Propeller 1
Hello,

For the past week I have been trying to duplicate what Hanno has done in the article from last year in Circuit Cellar Magazine. The link to it is here·.·I am using all the same hardware. Attached is the schematic I am working with.

I have soldered a total of 4 ADC08100 A/D chips to TSSOP to DIP adapters, all have tested good. I have tried this with the gadget gangster propeller platform module(2 of them), I have also tried it with the Parallax protoboards as well.

I have tried all sorts of different wiring(different sizes as well)·thinking it might be·some sort of ground problem or·analog noise issue, but·I have not been able to come up with a solution.·All connections are short as possible.

I have been emailing back and fourth with Hanno on this, but we are both at a loss at this point.

Using viewport I can get a display, however the quality is too low, not even useable for any app.

I have also tried 3 different CCam2-a modules, all new.

I have also tried separate power supplys, a different computer, different usb cables, and even re-installed viewport. I am looking for any ideas at this point.

Thank You
550 x 223 - 56K
«1

Comments

  • Bill HenningBill Henning Posts: 6,445
    edited 2010-02-04 20:05
    I would:

    - replace the 100R resistor with 75R
    - add a 100nF decoupling cap between any Vdd pin and nearest GND
    - put a scope on the camera output and make sure you are getting enough voltage swing
    - try feeding the video out to a TV and see if you get a decent image
    - make sure there is enough light on whatever you are trying to image

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com 5.0" VGA LCD in stock!
    Morpheus dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory/IO kit $89.95, both kits $189.95 SerPlug $9.95
    Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
    Las - Large model assembler Largos - upcoming nano operating system
  • charleyshfcharleyshf Posts: 165
    edited 2010-02-04 21:42
    Bill Henning said...
    I would:

    - replace the 100R resistor with 75R
    - add a 100nF decoupling cap between any Vdd pin and nearest GND
    - put a scope on the camera output and make sure you are getting enough voltage swing
    - try feeding the video out to a TV and see if you get a decent image
    - make sure there is enough light on whatever you are trying to image

    Thank you for the responce. I have tried different size resistors from 50R - 150R which only worked on the brightness of the video. Also I have added 100nf decoupling caps where ever there is vdd to the·nearest ground, still did not make any difference. Also I have tested all the Ccam2a's I have and when hooked to a monitor the picture quality is good. I don't have access to a scope so I am kinda SOL there.
    I attached a picture to show what kind of video I am getting with this setup.
    804 x 541 - 225K
  • BradCBradC Posts: 2,601
    edited 2010-02-04 23:46
    Are you _absolutely_ positive you have your data pins wired correctly?

    The edges on your image look nice and sharp, but the brightness looks screwy (kinda like you might get if you flipped a pair of data lines from the ADC)

    Download/Print a set of Greyscale bars something like this www.mediacollege.com/video/test-patterns/grayscale.html and see what your results look like.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • charleyshfcharleyshf Posts: 165
    edited 2010-02-05 03:34
    BradC said...
    Are you _absolutely_ positive you have your data pins wired correctly?

    The edges on your image look nice and sharp, but the brightness looks screwy (kinda like you might get if you flipped a pair of data lines from the ADC)

    Download/Print a set of Greyscale bars something like this www.mediacollege.com/video/test-patterns/grayscale.html and see what your results look like.

    Hi,

    Thank you for the link.
    I downloaded that grayscale chart, and it looks like something is backwards, I'm going to go through the wiring again..
  • charleyshfcharleyshf Posts: 165
    edited 2010-02-05 04:06
    I probably should include the wiring I am using.

    ADC08100 Pins --> Propeller Pins

    Pin24(CLK) Pin8(P8)
    Pin23 (GROUND)
    Pin22 NC
    Pin21 NC
    Pin20 NC
    Pin19 NC
    Pin18 VDD(+3VDC)
    Pin17 GROUND
    Pin16 (D4) Pin7(P7)
    Pin15 (D5) Pin6(P6)
    Pin14 (D6) Pin5(P5)
    Pin13 (MSB) Pin4(P4)
  • BradCBradC Posts: 2,601
    edited 2010-02-05 07:14
    Have a look at the diagram you put in your first post, then have another *close* look at the connections on your data bus (D4-D7).

    You have connected the MSB of the ADC to the LSB of the prop... and so on...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • charleyshfcharleyshf Posts: 165
    edited 2010-02-05 11:05
    BradC said...
    Have a look at the diagram you put in your first post, then have another *close* look at the connections on your data bus (D4-D7).

    You have connected the MSB of the ADC to the LSB of the prop... and so on...

    Hello,

    The diagram is a little confusing,· I had emailed Hanno about the·diagram and he verified that my current pin connections are correct, the P0-P7 he has on that diagram are not the actual Propeller pins, rather it's a custom connector he had made for his dancebot. Hanno has a couple different version of his code out there, and the one I am using comes with the most recent version of viewport, here is a snippet of code that shows where the pins connect:

    ''change the first two constants to match where your adc input/output are
    · VIDEOSTART=4··· ''pins VIDEOSTART..VIDEOSTART+3 should connect to the 4MSB of the ADC
    · ADC_CLOCK_PIN=8 ''pin ADC_CLOCK_PIN should connect to your ADC's clock·



    ·
  • BradCBradC Posts: 2,601
    edited 2010-02-05 14:50
    Once more for good measure....

    VIDEOSTART=4 ''pins VIDEOSTART..VIDEOSTART+3 should connect to the 4MSB of the ADC

    To me, the 4MSB of an 8 bit ADC is D4/D5/D6/D7

    If you are using that in a nybble configuration to a propeller, it would make sense to have the "most" LSB, of the ADC, connected to the "most" LSB of the Propeller Nybble you are connecting to. Your connections still look backwards to me. Then again, I guess at least you are getting sync.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • mugurmugur Posts: 105
    edited 2010-02-05 17:01
    So Charley, what are the actual pins on the propeller, if the P0-P4 are not?
    I will like to try this also, i have a PCB done for this diagram.
    456 x 302 - 82K
  • charleyshfcharleyshf Posts: 165
    edited 2010-02-05 17:28
    BradC said...
    Once more for good measure....

    VIDEOSTART=4 ''pins VIDEOSTART..VIDEOSTART+3 should connect to the 4MSB of the ADC

    To me, the 4MSB of an 8 bit ADC is D4/D5/D6/D7

    If you are using that in a nybble configuration to a propeller, it would make sense to have the "most" LSB, of the ADC, connected to the "most" LSB of the Propeller Nybble you are connecting to. Your connections still look backwards to me. Then again, I guess at least you are getting sync.

    Well I reveresed the pins (D4-D7) on the ADC, and you were right, IT WORKS!!! THANK YOU SO MUCH!! After spending over a week on this thing it's working!!

    Now if I can just remember what I was going to do next .............

    ·
  • charleyshfcharleyshf Posts: 165
    edited 2010-02-05 17:42
    mugur said...
    So Charley, what are the actual pins on the propeller, if the P0-P4 are not?
    I will like to try this also, i have a PCB done for this diagram.
    WOW, nice PCB, let me know if you want to sell some of those!! The one thing is though I had to use a 75ohm resistor because of my lighting condition, just an idea, but could you add some sort of variable resistor?

    From what I have now, where the camera is working

    ADC08100 Pins --> Propeller Pins

    Pin24(CLK) Pin8(P8)
    Pin23 (GROUND)
    Pin22 NC
    Pin21 NC
    Pin20 NC
    Pin19 NC
    Pin18 VDD(+3VDC)
    Pin17 GROUND
    Pin16 (D4) Pin4(P4)
    Pin15 (D5) Pin5(P5)
    Pin14 (D6) Pin6(P6)
    Pin13 (D7 MSB) Pin7(P7)

    thanks



    Post Edited (charleyshf) : 2/5/2010 5:51:36 PM GMT
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-02-05 17:46
    Great!

    Can you post some screenshots so we can see the quality?
    charleyshf said...
    BradC said...

    Once more for good measure....

    VIDEOSTART=4 ''pins VIDEOSTART..VIDEOSTART+3 should connect to the 4MSB of the ADC

    To me, the 4MSB of an 8 bit ADC is D4/D5/D6/D7

    If you are using that in a nybble configuration to a propeller, it would make sense to have the "most" LSB, of the ADC, connected to the "most" LSB of the Propeller Nybble you are connecting to. Your connections still look backwards to me. Then again, I guess at least you are getting sync.

    Well I reveresed the pins (D4-D7) on the ADC, and you were right, IT WORKS!!! THANK YOU SO MUCH!! After spending over a week on this thing it's working!!


    Now if I can just remember what I was going to do next .............
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com 5.0" VGA LCD in stock!
    Morpheus dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory/IO kit $89.95, both kits $189.95 SerPlug $9.95
    Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
    Las - Large model assembler Largos - upcoming nano operating system
  • mugurmugur Posts: 105
    edited 2010-02-05 17:48
    Charlie, send me your address by PM and i will send you one board for free. I will try to adapt it for a variable resistor for you.
    You will just have to pay for shipping, but i think it will go fine if i am sending it to you in a letter. I am in Romania.
  • charleyshfcharleyshf Posts: 165
    edited 2010-02-05 17:54
    Sure can, keep in mind I have low quality lighting, but the setup is the same as the first pic, again thank you for your help!!




    Bill Henning said...
    Great!

    Can you post some screenshots so we can see the quality?
    charleyshf said...
    BradC said...

    Once more for good measure....

    VIDEOSTART=4 ''pins VIDEOSTART..VIDEOSTART+3 should connect to the 4MSB of the ADC

    To me, the 4MSB of an 8 bit ADC is D4/D5/D6/D7

    If you are using that in a nybble configuration to a propeller, it would make sense to have the "most" LSB, of the ADC, connected to the "most" LSB of the Propeller Nybble you are connecting to. Your connections still look backwards to me. Then again, I guess at least you are getting sync.

    Well I reveresed the pins (D4-D7) on the ADC, and you were right, IT WORKS!!! THANK YOU SO MUCH!! After spending over a week on this thing it's working!!


    Now if I can just remember what I was going to do next .............
    804 x 541 - 189K
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-02-05 18:06
    Thanks!

    That is actually quite good considering it is only 16 level gray scale!

    (and you are most welcome)
    charleyshf said...
    Sure can, keep in mind I have low quality lighting, but the setup is the same as the first pic, again thank you for your help!!
    Bill Henning said...

    Great!

    Can you post some screenshots so we can see the quality?
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com 5.0" VGA LCD in stock!
    Morpheus dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory/IO kit $89.95, both kits $189.95 SerPlug $9.95
    Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
    Las - Large model assembler Largos - upcoming nano operating system
  • mugurmugur Posts: 105
    edited 2010-02-05 18:35
    The new PCB as Charley required.
    658 x 445 - 134K
  • HannoHanno Posts: 1,130
    edited 2010-02-05 19:38
    Awesome! Congrats BradC for figuring this out- after Charley and I had been banging our heads against the PCB for a week- you win a license for 12Blocks, check your mail... Charley, I'm so happy this is finally working, thanks for hanging in there. Mugur, will you be making more of your boards? I can include your info with ViewPort so in the future people will have an easier time than Charley did...
    Bill, I too was amazed by the image quality when I first saw it- remember that this is from a tiny, camera available here.- and it's video! At 2mbps you get ~10 frames/second.
    The site also sells also cheaper, $6 cameras...

    Now, try out the "face tracking" feature from OpenCV- it's integrated into ViewPort!
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Co-author of the official Propeller Guide- available at Amazon
    Developer of ViewPort, the premier visual debugger for the Propeller (read the review here, thread here),
    12Blocks, the block-based programming environment (thread here)
    and PropScope, the multi-function USB oscilloscope/function generator/logic analyzer
  • mugurmugur Posts: 105
    edited 2010-02-05 19:47
    Hello Hanno. I can make as many boards are needed. I suppose others will use this solution soon. I do have your last version of viewport, but unfortunatelly my 30 days are almost gone. Great job you did with that software. What i am interested to know is what if i use a very high quality camera, also B/W model, but with a much much better image?

    P.S. Thank you, BradC.
  • charleyshfcharleyshf Posts: 165
    edited 2010-02-05 20:02
    Hanno said...
    Awesome! Congrats BradC for figuring this out- after Charley and I had been banging our heads against the PCB for a week- you win a license for 12Blocks, check your mail... Charley, I'm so happy this is finally working, thanks for hanging in there. Mugur, will you be making more of your boards? I can include your info with ViewPort so in the future people will have an easier time than Charley did...
    Bill, I too was amazed by the image quality when I first saw it- remember that this is from a tiny, camera available here.- and it's video! At 2mbps you get ~10 frames/second.
    The site also sells also cheaper, $6 cameras...

    Now, try out the "face tracking" feature from OpenCV- it's integrated into ViewPort!
    Hanno

    Hanno,

    These guys are GREAT!! I was starting to worry you weren't going to email me back anymore with all the problems I had!!!shocked.gif I know there are others out there that have run into the same problem and either gave up or are waiting for someone else to say "hey it's working" . I think that this is a really useful addon for any robot!

    After working on this for over a week and getting help to get it going I had to sit back and actually try to remember why I started working on this... ·That would be my bot that is in a box in parts still waiting for me to put it together!

    Thanks again everyone!!

    ·
  • hover1hover1 Posts: 1,929
    edited 2010-02-05 21:57
    That does not match the diagram in the book. The book shows on page 260:
    ADC08100    Prop
    CLK (24)    Pin 40 (P15)
    D0  (22)    Pin 3  (P16)
    D1  (21)    Pin 4  (P17)
    D2  (20)    Pin 5  (P18)
    D3  (19)    Pin 6  (P19)
    D4  (16)    Pin 7  (P20)
    D5  (15)    Pin 8  (P21)
    D6  (14)    Pin 9  (P22)
    D7  (13)    Pin 10 (P23)
    

    But I think the Propeller Pinout on page 260 is in error. Take for example Pin 40 (called P15). On the DIP package, this would be P31. On the LQFD, it would be VDD. They just don't match up.
    Unless these are referring to nomenclature on a board that has nothing to do with the Propeller pinout, in which case it might be a little confusing.
    Jim
    charleyshf said...
    mugur said...
    So Charley, what are the actual pins on the propeller, if the P0-P4 are not?
    I will like to try this also, i have a PCB done for this diagram.
    WOW, nice PCB, let me know if you want to sell some of those!! The one thing is though I had to use a 75ohm resistor because of my lighting condition, just an idea, but could you add some sort of variable resistor?

    From what I have now, where the camera is working

    ADC08100 Pins --> Propeller Pins

    Pin24(CLK) Pin8(P8)
    Pin23 (GROUND)
    Pin22 NC
    Pin21 NC
    Pin20 NC
    Pin19 NC
    Pin18 VDD(+3VDC)
    Pin17 GROUND
    Pin16 (D4) Pin4(P4)
    Pin15 (D5) Pin5(P5)
    Pin14 (D6) Pin6(P6)
    Pin13 (D7 MSB) Pin7(P7)

    thanks

  • mugurmugur Posts: 105
    edited 2010-02-05 22:11
    That might be a typo, right?
  • hover1hover1 Posts: 1,929
    edited 2010-02-05 23:33
    I'm not sure. But Hanno refers to Propeller pins 19,23, 24 in Chapter 6 as being Vision pins. More confusion.

    Granted I have not read both chapters completley through yet so I may be talking out of turn, I am just saying it looks a little confusing to the casual observer.

    I know Hanno will chime in a straighten this out. He has never let us down before with his great products and projects.

    Jim
  • BradCBradC Posts: 2,601
    edited 2010-02-06 00:04
    Given the inversion I'm stuffed if I know how it synced. Glad you got it sorted though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • HannoHanno Posts: 1,130
    edited 2010-02-06 00:25
    Hi!
    I apologize for not being consistent across my projects. I have multiple implementation of the vision grabber hardware- one on the DanceBot (which uses pins 19..23 and 24 as clock) and another using the IODreamkit (pins 4..7 and 8 as clock). ViewPort's "PropCVCapture.spin" object let's you define which pins to monitor using the "VIDEOSTART" constant. I currently default this to 4- meaning the ADC's output should be on pins 4,5,6,7- with 7 being the most significant bit of the ADC. Pin 8 is used to provide a clock to the ADC. This is what's shown in Chapter 7. The video capture algorithm only captures those 4 bits, but if you want you can connect the lower 4 bits as well and use program #9 as an oscilloscope.
    Amazing the video synched at all!
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Co-author of the official Propeller Guide- available at Amazon
    Developer of ViewPort, the premier visual debugger for the Propeller (read the review here, thread here),
    12Blocks, the block-based programming environment (thread here)
    and PropScope, the multi-function USB oscilloscope/function generator/logic analyzer
  • charleyshfcharleyshf Posts: 165
    edited 2010-02-06 00:28
    Hello,



    Actually what I was working on was from a link from an article I·was wokring on·from last year, in the new book I posted in this thread here:

    http://forums.parallax.com/showthread.php?p=877819



    Just waiting for them to confirm it.


    hover1 said...
    That does not match the diagram in the book. The book shows on page 260:
    ADC08100    Prop
    CLK (24)    Pin 40 (P15)
    D0  (22)    Pin 3  (P16)
    D1  (21)    Pin 4  (P17)
    D2  (20)    Pin 5  (P18)
    D3  (19)    Pin 6  (P19)
    D4  (16)    Pin 7  (P20)
    D5  (15)    Pin 8  (P21)
    D6  (14)    Pin 9  (P22)
    D7  (13)    Pin 10 (P23)
    

    But I think the Propeller Pinout on page 260 is in error. Take for example Pin 40 (called P15). On the DIP package, this would be P31. On the LQFD, it would be VDD. They just don't match up.
    Unless these are referring to nomenclature on a board that has nothing to do with the Propeller pinout, in which case it might be a little confusing.
    Jim
    charleyshf said...
    mugur said...
    So Charley, what are the actual pins on the propeller, if the P0-P4 are not?
    I will like to try this also, i have a PCB done for this diagram.
    WOW, nice PCB, let me know if you want to sell some of those!! The one thing is though I had to use a 75ohm resistor because of my lighting condition, just an idea, but could you add some sort of variable resistor?

    From what I have now, where the camera is working

    ADC08100 Pins --> Propeller Pins

    Pin24(CLK) Pin8(P8)
    Pin23 (GROUND)
    Pin22 NC
    Pin21 NC
    Pin20 NC
    Pin19 NC
    Pin18 VDD(+3VDC)
    Pin17 GROUND
    Pin16 (D4) Pin4(P4)
    Pin15 (D5) Pin5(P5)
    Pin14 (D6) Pin6(P6)
    Pin13 (D7 MSB) Pin7(P7)

    thanks

  • hover1hover1 Posts: 1,929
    edited 2010-02-06 00:35
    My feelings also.
    Jim
    Hanno said...
    Amazing the video synched at all!
    Hanno

  • mugurmugur Posts: 105
    edited 2010-02-12 12:03
    Anyone being able to answer the question i had some posts ago?
    "What i am interested to know is: what if i use a very high quality camera, also B/W model, but with a much much better image?"
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-02-12 14:59
    What you need first is more grayscale levels for the output, which means you need to use more memory... and more bits from the ADC.
    mugur said...
    Anyone being able to answer the question i had some posts ago?
    "What i am interested to know is: what if i use a very high quality camera, also B/W model, but with a much much better image?"
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com 5.0" VGA LCD in stock!
    Morpheus dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory/IO kit $89.95, both kits $189.95 SerPlug $9.95
    Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
    Las - Large model assembler Largos - upcoming nano operating system
  • mugurmugur Posts: 105
    edited 2010-02-12 20:33
    I see Bill. So, it means will not harm in any way if i am using a better camera.
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-02-12 20:51
    No harm, but you are unlikely to get noticeably better picture quality until you use more than four bits of A/D resolution.
    mugur said...
    I see Bill. So, it means will not harm in any way if i am using a better camera.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com 5.0" VGA LCD in stock!
    Morpheus dual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory/IO kit $89.95, both kits $189.95 SerPlug $9.95
    Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
    Las - Large model assembler Largos - upcoming nano operating system
Sign In or Register to comment.