Nokia 3310 and servo motors


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Posts
    10

    Question Nokia 3310 and servo motors

    Can someone take a look at my code and tell me why my RC servos won't move when I use the include LCD_3310v32.inc. If I remove that include the program works as it should. I have a project that I'm working on that could really use the LCD for feedback, without being tethered to a computer via USB port. The program compile and runs just the servos don't move. Again if I remove the Include the servos do exactly as programmed. I'm totally stumped!

    Code:
    DEFINE OSC 48
    DEFINE ADC_BITS 8
    DEFINE ADC_CLOCK 3 
    DEFINE ADC_SAMPLEUS 50
    
    'Include "modedefs.bas"      ' Include serial modes.
    'include "LCD_3310v32.inc"   
    
    ADCON1 = %00001011
    
    Pulse var word
    TRISA = %00000000
    TRISB = %00000000
    TRISC = %00000000
    
    Start:
    Pulse = 0
    PORTB.1 = 1
    for Pulse = 1000 to 1500 step 1
        PORTC.0 = 1
        pauseus Pulse
        PORTC.0 = 0
        pause 15
    next Pulse  
    PORTB.1 = 0
    pause 250
    PORTB.1 = 1  
    for Pulse = 1500 to 1000 step -1
        PORTC.0 = 1
        pauseus Pulse
        PORTC.0 = 0
         pause 15
    next Pulse  
    PORTB.1 = 0
    
    PORTB.1 = 1
    for Pulse = 1000 to 2000 step 1
        PORTC.1 = 1
        pauseus Pulse
        PORTC.1 = 0
        pause 15
    next Pulse  
    PORTB.1 = 0
    pause 250
    PORTB.1 = 1  
    for Pulse = 2000 to 1000 step -1
        PORTC.1 = 1
        pauseus Pulse
        PORTC.1 = 0
         pause 15
    next Pulse  
    PORTB.1 = 0
    Goto Start
    All the code does is move two servos through their rotations left and right. It took me two days of troubleshooting to figure out what the problem was. But looking over the include file I still cannot find the problem. I've looked through the forum and haven't found this problem.
    Any help is greatly appreciated!
    Larry
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Nokia 3310 and servo motors

    The include file has the statement ...

    goto Start ' Jump out to main program (whatever is using this Include).

    In your program, Start is after the ADCON1 and TRIS statements.
    Those lines don't get executed, therefore your servo's won't work.
    DT

  3. #3
    Join Date
    Mar 2010
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: Nokia 3310 and servo motors

    Darrel,
    Thanks for explaining that. I had read that while looking through the code and it just didn't hit me. I had downloaded the V4 code last night and that doesn't have that line in it. Worked perfectly.
    Thanks for your help!
    Larry

Similar Threads

  1. Nokia 3310 LCD
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 2nd April 2008, 20:19
  2. Nokia 3310 to hyperterminal
    By joseph Degorio in forum GSM
    Replies: 0
    Last Post: - 15th September 2007, 09:26
  3. Nokia 3310 16f877
    By chai98a in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 5th September 2007, 15:32
  4. nokia 3310 lcd!! (help)
    By ibra in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd August 2007, 12:20
  5. Nokia 3310 LCD
    By barkerben in forum General
    Replies: 3
    Last Post: - 10th December 2005, 19:08

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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