connect two pics


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    Thank you for your replies.

    When I say it doesnt work well I mean when I make a program for big PICs and I want for example rotate one dc motor right then pause 2 sec then rotate left pause 3 sec etc, it just dont work or work wrong, for example it will rotate only right and then stop working at all or if its a big loop it maybe stop in the middle of the program.With small pics it works like champion.


    Are there some examples with serial communication? I tried to find the "sixpics" project someone mention but there isn't in melabs program examples.

    Thank you very much.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by soki View Post
    When I say it doesnt work well I mean when I make a program for big PICs and I want for example rotate one dc motor right then pause 2 sec then rotate left pause 3 sec etc, it just dont work or work wrong, for example it will rotate only right and then stop working at all or if its a big loop it maybe stop in the middle of the program.With small pics it works like champion.
    Quite frankly, to me, that just doesn't make any sense. But, I'll bet, I'd just bet, if, and only if, you posted the code that you used in both PICs, the one that worked and the one that failed, you might, just might, get a quick answer as to why one works and the other one seems to fail.
    But that would be just too easy...

    Are there some examples with serial communication? I tried to find the "sixpics" project someone mention but there isn't in melabs program examples.
    Ya know what works for me?
    Typing 'Serial Communication between 2 PICs' in the Search box.
    Crazy how that works ain't it?

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I agree with Jumper, find the problem.
    Maybe post the problem code??

    SERIAL-- really simple example . Much more to add, but the basic idea.
    SEND
    Code:
    SEROUT2, PORTX.X, MODE,[DEC 9]
    RECEIVE
    Code:
    SERIN2, PORTX.X, MODE,[DEC VAR]
    IF VAR = 9 THEN LABELX
    Last edited by mackrackit; - 19th September 2008 at 16:07.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default 877A doh :-)

    If you have connected anything on PORTA and you dont get the results you want.... this one I leave for Melanie to answer if needed :-)

    Show us your HW setup and some code, it should not be rocket science to rotate a DC motor with the 877A.

    So dont give into Plan Z just yet.

    /me

  5. #5
    Join Date
    Jun 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    The program I put in both small and big pics are the same,not different programs! On small pics it work on big not well!

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by soki View Post
    The program I put in both small and big pics are the same,not different programs! On small pics it work on big not well!
    And there are hardware differences between the two PICs...
    Is there some reason why we shouldn't see your program? State secret or something?

  7. #7
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default The bigger PIC

    The bigger PIC has tons of nice functions and these needs to be disabled/enabled/taken care of/set up/deactivated......etc

    So tell us what you have connected where and all your regiter settings.. TRIS ADCON etc if you think your code it too big/secret to post here.

    But if you insist of doing a 2 pic project feel free. And if you do that.. why use serial communication when it should be enough to use 2 pins as input on the small pic... as long pin-xx is high rotate left, if pin-yy is high rotate right...

    but... naaah.... if you already have code working for a small pic... what PIC is that? It cant be a 16F84 since that has no A/D....

    the plot thickens

    /me
    Last edited by Jumper; - 19th September 2008 at 16:58.

  8. #8
    Join Date
    Jun 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    You guys are great and have humor!

    Thank you for your answers!

    How wrong I can be with that simple program?

    TRISB = 0 ' PORTB is output
    PORTB.0 = 1 'enable1 of L293d is always high so input 1 and input 2 are available
    start:
    PORTB.1 = 1 'input1 of l293d goes high, so output 1 goes high so turns left
    PORTB.2 = 0 'input2 of l293d goes low, so output 2 goes low so turns left
    pause 2000
    PORTB.1 = 0 'the opposite, turns right
    PORTB.2 = 1
    pause 3000
    PORTB.1 = 0 'stop the dc motors
    PORTB.2 = 0
    goto start 'loop
    Last edited by soki; - 19th September 2008 at 17:34.

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    So what's the problem?

Similar Threads

  1. Free Project - 245 LED Display
    By T.Jackson in forum Code Examples
    Replies: 221
    Last Post: - 16th August 2009, 05:59
  2. Retrieving infos from multiple PICs on a bus/chain
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th October 2007, 05:42
  3. connect 2 PICs
    By drama in forum mel PIC BASIC
    Replies: 1
    Last Post: - 4th October 2007, 17:55
  4. Multiple PIC's with 1 crystal
    By puma in forum Schematics
    Replies: 11
    Last Post: - 20th March 2007, 18:02
  5. Replies: 5
    Last Post: - 21st August 2006, 00:09

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