Thanks for the reply.
I was actually meaning to refer to the L293D but accidentally made a typo in the thread title.
Anyways, I have some knowledge now and I'm trying to program my pic on mikroBasic PRO but I'm having some small issues in the code.
Code:
program Prog1
'int x;
main:
PORTA = 0
ANSEL = 0
TRISC = 0b110000
T1CON = 0b00010001
for x = 1 to 50
{
PORTC = 0b001010;
PORTC = 0b000110;
PORTC = 0b000101;
PORTC = 0b001001;
for (n = 0; n < 259; n++); // 4ms Delay
}
end
Here are the errors:
0 1 mBPic.exe -DBG -pP16F684 -MSF -Y -DL -O11111114 -fo8 -N"C:\Users\***\Desktop\PIC16F684 Program\Prog1.mbppi" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroBasic PRO for PIC\defs\" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroBasic PRO for PIC\Uses\P16\" -SP"C:\Users\***\Desktop\PIC16F684 Program\" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl" "__Lib_CType.mcl" "__Lib_String.mcl" "__Lib_Conversions.mcl" "__Lib_Time.mcl" "__Lib_Trigon.mcl" "__Lib_Trigonometry.mcl" "__Lib_Button.mcl" "__Lib_Manchester.mcl" "__Lib_OneWire.mcl" "__Lib_PS2.mcl" "__Lib_Sound.mcl" "__Lib_SoftI2C.mcl" "__Lib_SoftSPI.mcl" "__Lib_SoftUART.mcl" "__Lib_ADC_A_B.mcl" "__Lib_EEPROM.mcl" "__Lib_PWM_c5.mcl" "__Lib_LcdConsts.mcl" "__Lib_Lcd.mcl" "Prog1.mbas"
0 155 Available RAM: 112 [bytes], Available ROM: 2048 [bytes]
0 133 Compilation Started C:\Users\***\Desktop\PIC16F684 Program\Prog1.mbas
1 1015 Hint: Compiling unit "C:\Users\***\Desktop\PIC16F684 Program\Prog1.mbas" Prog1.mbas
9 304 Syntax error: Expected "integral constant" but "0b110000" found Prog1.mbas
10 304 Syntax error: Expected "integral constant" but "0b00010001" found Prog1.mbas
12 301 "for"is not valid identifier Prog1.mbas
12 304 Syntax error: Expected "end" but "for" found Prog1.mbas
12 304 Syntax error: Expected "." but "x" found Prog1.mbas
0 102 Finished (with errors): 24 Feb 2011, 13:54:22 Prog1.mbppi
I know its a bit long but any help is appreciated. I'm basically trying to move my stepper motor 50 steps by sending Ports C0-3 with information from the table below:
Step wire 1 wire 2 wire 3 wire 4
1 High low high low
2 low high high low
3 low high low high
4 high low low high
The combination of the 4 steps moves the motor 1 step...hope all this makes sense.