connect two pics


Closed Thread
Results 1 to 29 of 29

Hybrid View

  1. #1
    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 15:07.
    Dave
    Always wear safety glasses while programming.

  2. #2
    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

  3. #3
    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!

  4. #4
    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?

  5. #5
    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 15:58.

  6. #6
    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 16:34.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    So what's the problem?

  8. #8
    Join Date
    Jun 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    And the schematic, the l293d is also connected right(ground,vs,vss) but not shown on this schematic
    Attached Images Attached Images  

  9. #9
    Join Date
    Jun 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    So what's the problem?
    not work well the last time I checked, and believe me I tried many times.

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


    Did you find this post helpful? Yes | No

    Default so..

    You say you have 2 pics, one small and one big and then you use the same code in both. In the small pic everything is dandy but with the 877A it is not working properly.

    the code.... I agree.. what can go wrong... so the answer is probably not in the lines you posted.

    What FQ do your run the pics on, and where do you get this one from?
    Maybe DEFINE OSC XX in the beginning could help ....

    Configurations bits... a long story.. and the bigger the pic.... the longer the story.. the best way to set configuration bits is by adding them to the code. How this is done depends if you use MPASM or not. Search the forum and add these bits into the top of your program... These have a significant effect on the pics behaviour.

    OSC XT HS RC LP
    Watchdog on off
    Brown out or not
    etc etc.. add all config bits you have for the device in the code

    all these you can find in the datasheet....


    And you still didnt answer how you power the pic and if you have caps close to the power pins.



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

Similar Threads

  1. Free Project - 245 LED Display
    By T.Jackson in forum Code Examples
    Replies: 221
    Last Post: - 16th August 2009, 04: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, 04:42
  3. connect 2 PICs
    By drama in forum mel PIC BASIC
    Replies: 1
    Last Post: - 4th October 2007, 16:55
  4. Multiple PIC's with 1 crystal
    By puma in forum Schematics
    Replies: 11
    Last Post: - 20th March 2007, 17:02
  5. Replies: 5
    Last Post: - 20th August 2006, 23: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