16F628 and LMX2306 PLL loading.. help


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Posts
    15

    Default 16F628 and LMX2306 PLL loading.. help

    OK, I have been trying to get this to work in my spare time over the past couple weeks and I seem to have hit a roadblock.

    Using a 16F628 PIC I am trying to load bit strings into an LMX2306 PLL chip using SHIFTOUT commands. The PLL is never loading. I used almost Identical code in a Parallax Basic Stamp Homework Board and it worked no problems.

    PLL is confirmed working by plugging it into National's codeloader software and also my Parallax board. All connections have been checked many many times. Here is the code if anyone would like to see if I am missing something simple.

    Please help me, I know there are some big brains around here.


    CODE:-------------------------------------

    TRISB = %11111111 'set all pins 0-7 to input
    TRISA = %00111100 'set pins 0,1,6,7 to output and pins 2,3,4,5 to input
    CMCON = %00000111 'turn off on-board comparators

    Include "modedefs.bas"

    Low PORTA.6

    Pause 500

    SHIFTOUT PORTA.7,PORTA.0,MSBFIRST,[0\13, 131\8] 'send F reg
    High PORTA.6 'LE high
    PAUSE 10
    Low PORTA.6 'LE low


    SHIFTOUT PORTA.7,PORTA.0,MSBFIRST,[0\9, 4000\12] 'send R reg
    High PORTA.6 'LE high
    PAUSE 10
    Low PORTA.6 'LE low


    SHIFTOUT PORTA.7,PORTA.0,MSBFIRST,[1\1, 2566\13, 2\5, 1\2] 'send N reg
    High PORTA.6 'LE high
    PAUSE 10
    Low PORTA.6 'LE low

    -------------------------------------:END CODE

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    You're using Port A.7, which is also OSC1.
    Are you sure you've configured the clock correctly to use this pin as an I/O?
    http://www.picbasic.co.uk/forum/show...setting+config

    Are you sure you're PIC is even running in the first place? How does that blinky LED work?

  3. #3
    Join Date
    Jan 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    The LE high and low is not an LED but a Latch enable on the PLL chip to tell it to load in the data in the shift register when shifting is done.

    I probably should set an led somewhere to blink to confirm operation of the micro controller. Will do this next.

    I am using an MELabs U2 Programmer. It reads and writes no problems. I have set the oscillator to INTRCIO in the MELabs programmer, which should be the internal oscillator?, and still no dice.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kessral View Post
    I probably should set an led somewhere to blink to confirm operation of the micro controller. Will do this next.
    It's always been my 2nd step after a failure...
    Actually that's not true. Everything I've built in the past few years has included a 'heartbeat' LED driven by a timer interrupt. LED blinks, no questions as to whether or not the circuit is operating...correctly or otherwise...

  5. #5
    Join Date
    Jan 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Well I changed the code to this:

    TRISB = %11111111 'set all pins 0-7 to input
    TRISA = %00111100 'set pins 0,1,6,7 to output and pins 2,3,4,5 to input
    CMCON = %00000111 'turn off on-board comparators

    Include "modedefs.bas"

    Low PORTA.1 'for LED
    Low PORTA.6

    Pause 500

    SHIFTOUT PORTA.7,PORTA.0,MSBFIRST,[0\13, 131\8] 'send F reg
    High PORTA.6 'LE high
    PAUSE 10
    Low PORTA.6 'LE low

    high porta.1
    pause 500 'blink LED
    low porta.1

    SHIFTOUT PORTA.7,PORTA.0,MSBFIRST,[0\9, 4000\12] 'send R reg
    High PORTA.6 'LE high
    PAUSE 10
    Low PORTA.6 'LE low

    high porta.1
    pause 500 'blink LED
    low porta.1

    SHIFTOUT PORTA.7,PORTA.0,MSBFIRST,[1\1, 2566\13, 2\5, 1\2] 'send N reg
    High PORTA.6 'LE high
    PAUSE 10
    Low PORTA.6 'LE low

    high porta.1
    pause 500 'blink LED
    low porta.1

    ---------------------------------------------
    No blinking going on and no highs on an scope from pin 18. Does this mean it is a bad chip even though it reads and writes fine? Or is there something amiss/wrong in my code?

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by kessral View Post
    Well I changed the code to this:
    well then, change the code to this:
    Code:
    trisb=$ff:trisa=$3c:cmcon=7
    main: porta.1=1:pause 500:porta.1=0:pause 500:goto main
    goto main
    That's known as ol' blinky... See how it's about as simple as you can get...the lowest common denominator...end of the line...edge of the cliff...low man on the pole...last drop in the bucket...
    If something like that doesn't work, then I'd be willing to bet that any communications you are trying to do with that LMX2306, or any other chips anywhere in this world (or others) at this time (or any other in the past or the future or otherwise) isn't going to work either.

    Does this mean it is a bad chip even though it reads and writes fine?
    I've got this car in the backyard. The doors open and close just fine...but it won't start. Does that mean the whole car is bad?

    Or is there something amiss/wrong in my code?
    Ya think?
    Is your circuit perfect? Are you sure? HOW can you be sure? Does the code you've tried run? No? Then you can't be sure your circuit is perfect... ALL you can do is assume.

    In other words..............
    Break it back down...then build it up in steps...

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