LCD and PIC18F4550


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38


    Did you find this post helpful? Yes | No

    Smile

    Thanks,

    I'll try your solution when I get my stepper motors running. They seem to just vibrate, and I'm sure the wiring is correct as I had it working on a PIC16F877.

    Cheers,

    Sterling

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


    Did you find this post helpful? Yes | No

    Default

    If your steppers are on PORTA or PORTB. ADCON1 will probably fix them too.
    <br>
    DT

  3. #3
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38


    Did you find this post helpful? Yes | No

    Question

    I tried that:

    DEFINE OSC 48

    ADCON1 = $0F

    ' set variables:
    x VAR BYTE
    steps VAR WORD
    stepArray VAR BYTE(4)
    clear

    TRISB = %11110000
    PORTB = 255

    Pause 1000

    stepArray[0] = %00001010
    stepArray[1] = %00000110
    stepArray[2] = %00000101
    stepArray[3] = %00001001


    main:
    if 1 = 1 then
    steps = steps + 1
    else
    steps = steps - 1
    endif

    PORTB = stepArray[steps //4]
    pause 2

    GoTo main

  4. #4
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    you may wonder about some of the code. It was originally written for a button to determine the direction, but to make it less confusing, I just say 1=1 to get to the heart of the code. I could have taken it out, but it will go back in.

    -Sterling

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


    Did you find this post helpful? Yes | No

    Default

    I figured as much.

    When I look at this page ...
    http://www.sas.org/E-Bulletin/2002-0...ctro/body.html

    Your phase sequence seems to be different.
    I guess it depends on which pin connects to which phase.

    Might try a little more than 2ms delay to start too.
    <br>
    DT

  6. #6
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38


    Did you find this post helpful? Yes | No

    Question

    I've monkeyed around with the delay, gone all the way up to 20ms.

    I had this wiring working on another PIC, so I am pretty sure it should work, unless that program, written ASM was sending different bytes out the port.

    I'll check, if I can decipher it.

    Cheers,

    Sterling

  7. #7
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    So I looked into the ASM code that sucessfully drove the motor, and made the BYTE output changes to match, but still no luck.

    I'm wondering if it could have something to do with the chips high speed of 48MHz?

    -Sterling

Similar Threads

  1. DS18B20 and PIC18F4550
    By sjohansson in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th April 2006, 19:57
  2. Replies: 5
    Last Post: - 26th March 2006, 19:26

Members who have read this thread : 0

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