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!![]()
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!![]()
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.
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.
And the schematic, the l293d is also connected right(ground,vs,vss) but not shown on this schematic
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.![]()
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.
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.
Bookmarks