It is currently 21 Nov 2017 22:45

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 08 Sep 2017 11:50 
Offline

Joined: 24 Aug 2014 17:55
Posts: 88
Location: Sheffield
Should there be a c file in this library, I have installed it using the package manager but this is what happens when I compile code below.


#include <stdint.h>
#include "stepper2_simple_hw.h"
#include "stepper2_click_hal.h"


sbit STEPPER2_RST at LATE1_bit;
sbit STEPPER2_SL at LATE0_bit;
sbit STEPPER2_EN at LATA2_bit;
sbit STEPPER2_DIR at LATB0_bit;
sbit STEPPER2_ST at LATC0_bit;

sbit STEPPER2_RST_direc at TRISE1_bit;
sbit STEPPER2_SL_direc at TRISE0_bit;
sbit STEPPER2_EN_direc at TRISA2_bit;
sbit STEPPER2_DIR_direc at TRISB0_bit;
sbit STEPPER2_ST_direc at TRISC0_bit;

bit oldstate;
bit oldstate1;

void setup_buttons(void)
{
TRISD0_bit=1;
TRISD1_bit=1;
}


void Init_Mcu(void)
{
 ANSELA = 0;                                    // Configure  pins as digital
 ANSELB = 0;
  ANSELC= 0;                         
 ANSELD = 0;                                   
 ANSELE = 0;                                   
 TRISA=0x00;
 TRISB=0x00;
 TRISC=0x00;
 TRISD=0x00;
 TRISE=0x00;
 LATA=0;
 LATB=0;
 LATC=0;
 LATD=0;
 LATE=0;
}

void main()
{
Init_Mcu();
//stepper2_init();
//stepper2_enable(ENABLE);
while(1){
/************************************
       if (Button(&PORTD, 0, 1, 1)){               // Detect logical one
        oldstate = 1;                              // Update flag
   //     stepper2_set_direction(CW);
    //    stepper2_set_speed(5);
       
        }
       if (oldstate && Button(&PORTD, 0, 1, 0)) {   // Detect one-to-zero transition
     //  stepper2_run_time(10);
        oldstate = 0;
        }
       if (Button(&PORTD, 1, 1, 1)){               // Detect logical one
        oldstate1 = 1;                              // Update flag
     //   stepper2_set_direction(CCW);
     //   stepper2_set_speed(10);

        }
       if (oldstate1 && Button(&PORTD, 1, 1, 0)) {   // Detect one-to-zero transition
    //   stepper2_run_time(10);
        oldstate1 = 0;
        }
   *******************************/
     }  //end while
}       //end main



In compiler message box
Quote:
0 1 mikroCPIC1618.exe -MSF -DBG -pP18F45K22 -UICD -DL -O11111114 -fo8 -N"C:\Users\Mick\Desktop\WirePull\stepper2.mcppi" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\Defs\" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\uses\P18\" -SP"C:\Users\Mick\Desktop\WirePull\" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\Packages\Click Stepper 2\Uses\" -IP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\Packages\Click Stepper 2\Uses\" "stepper2.c" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl" "__Lib_Button.mcl" "stepper2_click_hal.mcl" "stepper2_simple_hw.mcl"
0 1139 Available RAM: 1515 [bytes], Available ROM: 32768 [bytes]
0 340 File 'C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\Packages\Click Stepper 2\Uses\stepper2_click_hal.c' not found
0 340 File 'C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\Packages\Click Stepper 2\Uses\stepper2_simple_hw.c' not found
0 102 Finished (with errors): 08 Sep 2017, 11:11:26 stepper2.mcppi

Or do I need to write my own c driver file?

Regards Dave

_________________
"When the bugs strike it's no good bashing your head against a brick wall, you might damage the wall"


Top
 Profile  
 
PostPosted: 11 Sep 2017 16:25 
Offline
mikroElektronika team
User avatar

Joined: 02 Feb 2017 14:21
Posts: 697
Hi,

Did you include the library from the library manager for the stepper 2 click ?

Regards,

_________________
Dusan Poluga.


Top
 Profile  
 
PostPosted: 12 Sep 2017 07:39 
Offline

Joined: 24 Aug 2014 17:55
Posts: 88
Location: Sheffield
Hi Dusan,
Thanks for reply,

Ok here is what is happening, program compiles fine when in release mode, but if I select to use ICD debug & Mikroc ICD in "project settings" that is when it compiles with error messages.

Quote:
0 1 mikroCPIC1618.exe -MSF -DBG -pP18F45K22 -UICD -DL -O11111114 -fo8 -N"C:\Users\Mick\Desktop\WirePull\stepper2.mcppi" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\Defs\" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\uses\P18\" -SP"C:\Users\Mick\Desktop\WirePull\" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\Packages\Click Stepper 2\Uses\" -SP"C:\Users\Mick\Desktop\DRV8825\" -IP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\Packages\Click Stepper 2\Uses\" "stepper2.c" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl" "__Lib_Button.mcl" "__Lib_PWM_c21.mcl" "stepper2_click_hal.mcl" "stepper2_simple_hw.mcl"
0 1139 Available RAM: 1515 [bytes], Available ROM: 32768 [bytes]
0 340 File 'C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\Packages\Click Stepper 2\Uses\stepper2_click_hal.c' not found
0 340 File 'C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\Packages\Click Stepper 2\Uses\stepper2_simple_hw.c' not found
0 102 Finished (with errors): 12 Sep 2017, 08:09:55 stepper2.mcppi


Kind regards
Dave

_________________
"When the bugs strike it's no good bashing your head against a brick wall, you might damage the wall"


Top
 Profile  
 
PostPosted: 13 Sep 2017 16:33 
Offline
mikroElektronika team
User avatar

Joined: 02 Feb 2017 14:21
Posts: 697
Hi,

I have sent some files to your email.

Regards,

_________________
Dusan Poluga.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: