PBP projects for R/C models


Closed Thread
Results 1 to 40 of 772

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Talking Lookit this great picture

    On the other hand==>

    Look at this great oscilloscope-like picture of the PWM pulses (fifty per second) very close to 1.75ms long created by Bruce's PAUSEUS technique. I finally figured out the Analyzer part of the PICkit 2 Logic Tool.

    Ken
    Attached Images Attached Images  

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post
    On the other hand==>

    Look at this great oscilloscope-like picture of the PWM pulses (fifty per second) very close to 1.75ms long created by Bruce's PAUSEUS technique. I finally figured out the Analyzer part of the PICkit 2 Logic Tool.

    Ken
    Now that's progress! Great job Ken. That a pretty nice looking scope, and the price makes it look even better!

    Now you can see what you are doing .... er (or not doing).

  3. #3
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Smile It compiles and measures!!

    Fritsl's code compiles and runs on my PICkit2.

    The proximity detector (Devantech SRF05) responds with different size pulses (depending on the distance from it to an echoing object) when queried by this code.

    Next to prove out control of the four DPDT switches which steer DC to the motor and to the servo, destroy the toy car by ripping out its radio receiver. and figure out how to mount the PICkit, the switches board and the two SRF05's.

    Question. Is there any way that I can read through the PICkit programmer what is happening in real time to some of the variables. How do I think about adding debugging code?

    Ken

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    In case someone wants to measure multiple RC channels with one CCP1 pin, I did a small expermiment. If you connect every other RC receiver channel to CCP pin using 1N914 diodes (or similar), you will be able to measure pulses from three (or four) RC channels using one pin. Without the diodes, the RC channels that are low, ground out the one that is trying to pulse.

    Here is a picture of RC channels 2,4, and 6. Without a channel space between them, they stay high. So, with a PIC that has two CCP pins, you should be able to read all 8 channels!

    This picture shows scope yellow probe (rc 2, 4, and 6) with their diodes attached to the scope probe. and scope red probe directly attached to RC channel 2.

    Attached Images Attached Images  
    Last edited by ScaleRobotics; - 7th February 2010 at 02:18.

  5. #5
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Lightbulb

    Come to think of it, using one CCP pin, you can decode (however many channels your RC transmitter has - 1). So, using a 6 channel transmitter, you can decode 5 channels using a chip with a single CCP compare pin. To do this, connect RC1, RC3 and RC5 channels from your receiver to the CCP pin with some diodes, and a pulldown resistor. Then capture every transition with capture. The in between pulses are RC channels 2 and 4.

    Now to write some code...

    Attached Images Attached Images  

  6. #6
    Join Date
    Nov 2009
    Location
    Fitchburg, Mass
    Posts
    483


    Did you find this post helpful? Yes | No

    Default I've got the proto car together.

    Individually the parts of the system seems to pass their tests.
    The DPDT switches worked according to their truth tables.
    The proximity switches echoed what looked like sensible responses.
    The wheels turned and the steering responded as the DPDT switches asked of them.

    However, the car does not work as a system. The PIC is running. The proximity sensors have LED's that blink when pulsed. These work. After a while the proximity detectors stop. All this is in the code, but the steering does not move at all. The wheels do not reverse when something is seen to be right in front of the car.

    Question is: What kinds of debugging power do I have once the code is in the PIC besides the Logic Tool Analyze mode?

    Ken

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kenjones1935 View Post
    Question is: What kinds of debugging power do I have once the code is in the PIC besides the Logic Tool Analyze mode?

    Ken
    You can hook up a serial LCD to the system and use debug to send the value stored in your variables, you can store port status in a variable and debug too.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. PBP Book
    By Bruce in forum Off Topic
    Replies: 83
    Last Post: - 4th October 2021, 12:55
  2. PBP Extensions, What are they?
    By PJALM in forum PBP Extensions
    Replies: 9
    Last Post: - 28th September 2021, 11:26
  3. Compiler differences between PBP 2.33 & 2.46
    By nikopolis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd May 2006, 19:01
  4. Newby- PBP wont compile for 18F (MPLAB)
    By jd76duke in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th December 2005, 23:30
  5. Making PBP code more modular
    By forgie in forum General
    Replies: 30
    Last Post: - 25th October 2005, 16:24

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts