Hi, I know I have unfinished topic in another thread, but I'm still waiting some parts to come, so I decided to move on to my simple mobile robot structure. The sensors mentioned from the other thread are going to be placed on this three wheeled robot. But I hit another brick wall. I've been losing my head since this morning..it's 2Am now already . I hope anybody can help me out..I'm having trouble driving the motors using PWM. When not using the PWM, motors work great...please see image\schematic below.
Attachment 6682
My setup
Attachment 6684
My codes:
Code:
Define OSC 20
ANSEL=%00000000
ANSELH=%00000000
TRISC = 0
PORTC = 0
TRISD = 0
PORTD = 0
MainLoop:
PortD.0 =1
PortD.1 =0
PortD.2 =1
PortD.3= 0
PortC.4 ,127, 100
PortC.5 ,127, 100
Goto MainLoop
Can any one spot what I'm doing wrong...I appreciate any input.
Kind regards,
tacbanon
Bookmarks