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

    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!

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

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

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

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    So what's the problem?

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

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

  8. #8
    Join Date
    Jun 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    I will try again today to connect directly l293d with the pic1678777a, the available ports left are portC and portD, which one to use? Should I take care extra something? I can give seperate voltage to l293d from a different +5V source.

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

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


    Did you find this post helpful? Yes | No

    Default Good

    OK,

    more questions... your 9V battery. What kind is that? Is that the normal small flat one or something with some real juice in?

    How many mA does the motor take in start up current?

    Nothing wrong with PORTB, this is a different problem.. but please power the L293D separetly. Add config bits to make sure at least brown out off and watchdog off.

    /me
    Last edited by Jumper; - 19th September 2008 at 17:03.

  11. #11
    Join Date
    Jun 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Jumper View Post
    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
    See the schematic attachment about how I power the PIC. I will try those configurations bits! Thanks!

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