//PIC Stuff/PICX_16F1829_BLE_IMU/Demo.py |
---|
0,0 → 1,55 |
import serial |
def twos_comp(val, bits): |
'''Convert given value from two's complement to integer''' |
if ((val & (1 << (bits-1))) != 0): |
val = val - (1 << bits) |
return val |
if __name__ == '__main__': |
print("Attempting to connect to serial port...") |
# Connect to specified serial port |
ser = serial.Serial() |
ser.baudrate = 115200 |
ser.port = "COM3" |
ser.timeout = 3 # Three second timeout |
try: |
ser.open() |
print("Connected to serial port.") |
# Loop reading in data from the sensor |
while(1): |
s = ser.read(19) |
# Ensure that the data properly ends in a newline |
if s[18] == ord('\n'): |
# Read in accelerometer data and convert from two's compliment |
A_X = ((s[1] << 8) | s[0]) |
A_Y = ((s[3] << 8) | s[2]) |
A_Z = ((s[5] << 8) | s[4]) |
A_X_N = twos_comp(A_X, 16) >> 4 |
A_Y_N = twos_comp(A_Y, 16) >> 4 |
A_Z_N = twos_comp(A_Z, 16) >> 4 |
# Read in gyroscope data and convert from two's compliment |
G_Y = (s[7] << 8) | s[6] |
G_X = (s[9] << 8) | s[8] |
G_Z = (s[11] << 8) | s[10] |
G_X_N = twos_comp(G_X, 16) |
G_Y_N = twos_comp(G_Y, 16) |
G_Z_N = twos_comp(G_Z, 16) |
# Read in magnetometer data and convert from two's compliment |
M_X = ((s[13] << 8) | s[12]) |
M_Y = ((s[15] << 8) | s[14]) |
M_Z = ((s[17] << 8) | s[16]) |
M_X_N = twos_comp(M_X, 16) |
M_Y_N = twos_comp(M_Y, 16) |
M_Z_N = twos_comp(M_Z, 16) |
# Print out the processed data |
print("A: %-6i %-6i %-6i G: %-6i %-6i %-6i M: %-6i %-6i %-6i" % \ |
(A_X_N, A_Y_N, A_Z_N, G_X_N, G_Y_N, G_Z_N, M_X_N, M_Y_N, M_Z_N)) |
else: |
break |
except: |
pass |
ser.close() |
//PIC Stuff/PICX_16F1829_BLE_IMU/I2C.c |
---|
55,7 → 55,7 |
} |
// Sends length number of bytes in msg to specified address (no R/W bit) |
void I2C_Master_Send(char address, char length, char *msg) { |
void I2C_Master_Send(char address, char *msg, char length) { |
char i; |
if (length == 0) |
return; |
101,7 → 101,7 |
char c; |
if (length == 0) { |
c = msg; |
I2C_Master_Send(address, 1, &c); |
I2C_Master_Send(address, &c, 1); |
return; |
} |
//PIC Stuff/PICX_16F1829_BLE_IMU/I2C.h |
---|
71,7 → 71,7 |
void I2C_Interrupt_Master(void); |
void I2C_Configure_Slave(char); |
void I2C_Configure_Master(char speed); |
void I2C_Master_Send(char address, char length, char *msg); |
void I2C_Master_Send(char address, char *msg, char length); |
void I2C_Master_Recv(char address, char length); |
void I2C_Master_Restart(char address, char msg, char length); |
char I2C_Get_Status(void); |
//PIC Stuff/PICX_16F1829_BLE_IMU/L3G.c |
---|
0,0 → 1,35 |
#include <xc.h> |
#include "main.h" |
#include "L3G.h" |
#include "I2C.h" |
void L3G_Init(void) { |
char c[2] = {L3G_CTRL_REG1, 0x0F}; |
I2C_Master_Send(ADDRESS_GYRO, &c, 2); |
while (!I2C_Get_Status()); |
} |
void L3G_Read_Gyro(char *x_L, char *x_H, |
char *y_L, char *y_H, |
char *z_L, char *z_H) { |
char result, length, buffer[10]; |
// Assert the MSB to autoincrement address |
char c = L3G_OUT_X_L | (1 << 7); |
I2C_Master_Restart(ADDRESS_GYRO, c, 6); |
do { |
result = I2C_Get_Status(); |
} while (!result); |
// Read received data |
length = I2C_Read_Buffer(buffer); |
// Data is received in low-high byte order |
*x_L = buffer[0]; |
*x_H = buffer[1]; |
*y_L = buffer[2]; |
*y_H = buffer[3]; |
*z_L = buffer[4]; |
*z_H = buffer[5]; |
} |
//PIC Stuff/PICX_16F1829_BLE_IMU/L3G.h |
---|
0,0 → 1,42 |
#ifndef L3G_H |
#define L3G_H |
// Register Addresses |
#define L3G_WHO_AM_I 0x0F |
#define L3G_CTRL_REG1 0x20 |
#define L3G_CTRL_REG2 0x21 |
#define L3G_CTRL_REG3 0x22 |
#define L3G_CTRL_REG4 0x23 |
#define L3G_CTRL_REG5 0x24 |
#define L3G_REFERENCE 0x25 |
#define L3G_OUT_TEMP 0x26 |
#define L3G_STATUS_REG 0x27 |
#define L3G_OUT_X_L 0x28 |
#define L3G_OUT_X_H 0x29 |
#define L3G_OUT_Y_L 0x2A |
#define L3G_OUT_Y_H 0x2B |
#define L3G_OUT_Z_L 0x2C |
#define L3G_OUT_Z_H 0x2D |
#define L3G_FIFO_CTRL_REG 0x2E |
#define L3G_FIFO_SRC_REG 0x2F |
#define L3G_INT1_CFG 0x30 |
#define L3G_INT1_SRC 0x31 |
#define L3G_INT1_THS_XH 0x32 |
#define L3G_INT1_THS_XL 0x33 |
#define L3G_INT1_THS_YH 0x34 |
#define L3G_INT1_THS_YL 0x35 |
#define L3G_INT1_THS_ZH 0x36 |
#define L3G_INT1_THS_ZL 0x37 |
#define L3G_INT1_DURATION 0x38 |
void L3G_Init(void); |
void L3G_Read_Gyro(char *x_L, char *x_H, |
char *y_L, char *y_H, |
char *z_L, char *z_H); |
#endif /* L3G_H */ |
//PIC Stuff/PICX_16F1829_BLE_IMU/LSM303.c |
---|
0,0 → 1,81 |
#include <xc.h> |
#include "main.h" |
#include "LSM303.h" |
#include "I2C.h" |
void LSM303_Init(void) { |
// Enable accelerometer, normal power mode, all axes enabled (100Hz) |
char c[2] = {LSM303_CTRL_REG1_A, 0x57}; |
I2C_Master_Send(ADDRESS_ACCL, &c, 2); |
while (!I2C_Get_Status()); |
// Enable high resolution mode, +- 2G |
char d[2] = {LSM303_CTRL_REG4_A, 0x08}; |
I2C_Master_Send(ADDRESS_ACCL, &d, 2); |
while (!I2C_Get_Status()); |
// Enable magnetometer, continuous conversion mode |
char e[2] = {LSM303_MR_REG_M, 0x00}; |
I2C_Master_Send(ADDRESS_MAGN, &e, 2); |
while (!I2C_Get_Status()); |
char f[2] = {LSM303_CRA_REG_M, 0x18}; // (75Hz) |
I2C_Master_Send(ADDRESS_MAGN, &f, 2); |
while (!I2C_Get_Status()); |
// LSM303_Set_Mag_Gain(magGain_40); |
} |
void LSM303_Set_Mag_Gain(magGain value) { |
char c[2]; |
c[0] = LSM303_CRB_REG_M; |
c[1] = (char)value; |
I2C_Master_Send(ADDRESS_MAGN, &c, 2); |
while (!I2C_Get_Status()); |
} |
void LSM303_Read_Accl(char *x_L, char *x_H, char *y_L, char *y_H, char *z_L, char *z_H) { |
char result, length, buffer[10] = {0}; |
// Assert the MSB to autoincrement address |
char c = LSM303_OUT_X_L_A | 0x80; |
I2C_Master_Restart(ADDRESS_ACCL, c, 6); |
do { |
result = I2C_Get_Status(); |
} while (!result); |
// Read received data |
length = I2C_Read_Buffer(buffer); |
// Data is received in low-high byte order |
*x_L = buffer[0]; |
*x_H = buffer[1]; |
*y_L = buffer[2]; |
*y_H = buffer[3]; |
*z_L = buffer[4]; |
*z_H = buffer[5]; |
} |
void LSM303_Read_Magn(char *x_L, char *x_H, char *y_L, char *y_H, char *z_L, char *z_H) { |
char result, length, buffer[10]; |
// Assert the MSB to autoincrement address |
char c = LSM303_OUT_X_H_M; |
I2C_Master_Restart(ADDRESS_MAGN, c, 6); |
do { |
result = I2C_Get_Status(); |
} while (!result); |
// Read received data |
length = I2C_Read_Buffer(buffer); |
// Data is received in high-low byte order |
*x_H = buffer[0]; |
*x_L = buffer[1]; |
*z_H = buffer[2]; |
*z_L = buffer[3]; |
*y_H = buffer[4]; |
*y_L = buffer[5]; |
} |
//PIC Stuff/PICX_16F1829_BLE_IMU/LSM303.h |
---|
0,0 → 1,100 |
#ifndef LSM303_H |
#define LSM303_H |
#define LSM303_CTRL_REG1_A 0x20 |
#define LSM303_CTRL_REG2_A 0x21 |
#define LSM303_CTRL_REG3_A 0x22 |
#define LSM303_CTRL_REG4_A 0x23 |
#define LSM303_CTRL_REG5_A 0x24 |
#define LSM303_CTRL_REG6_A 0x25 |
#define LSM303_REFERENCE_A 0x26 |
#define LSM303_STATUS_REG_A 0x27 |
#define LSM303_OUT_X_L_A 0x28 |
#define LSM303_OUT_X_H_A 0x29 |
#define LSM303_OUT_Y_L_A 0x2A |
#define LSM303_OUT_Y_H_A 0x2B |
#define LSM303_OUT_Z_L_A 0x2C |
#define LSM303_OUT_Z_H_A 0x2D |
#define LSM303_FIFO_CTRL_REG_A 0x2E |
#define LSM303_FIFO_SRC_REG_A 0x2F |
#define LSM303_INT1_CFG_A 0x30 |
#define LSM303_INT1_SRC_A 0x31 |
#define LSM303_INT1_THS_A 0x32 |
#define LSM303_INT1_DURATION_A 0x33 |
#define LSM303_INT2_CFG_A 0x34 |
#define LSM303_INT2_SRC_A 0x35 |
#define LSM303_INT2_THS_A 0x36 |
#define LSM303_INT2_DURATION_A 0x37 |
#define LSM303_CLICK_CFG_A 0x38 |
#define LSM303_CLICK_SRC_A 0x39 |
#define LSM303_CLICK_THS_A 0x3A |
#define LSM303_TIME_LIMIT_A 0x3B |
#define LSM303_TIME_LATENCY_A 0x3C |
#define LSM303_TIME_WINDOW_A 0x3D |
#define LSM303_CRA_REG_M 0x00 |
#define LSM303_CRB_REG_M 0x01 |
#define LSM303_MR_REG_M 0x02 |
#define LSM303_OUT_X_H_M 0x03 |
#define LSM303_OUT_X_L_M 0x04 |
#define LSM303_OUT_Y_H_M 0x05 |
#define LSM303_OUT_Y_L_M 0x06 |
#define LSM303_OUT_Z_H_M 0x07 |
#define LSM303_OUT_Z_L_M 0x08 |
#define LSM303_SR_REG_M 0x09 |
#define LSM303_IRA_REG_M 0x0A |
#define LSM303_IRB_REG_M 0x0B |
#define LSM303_IRC_REG_M 0x0C |
#define LSM303_TEMP_OUT_H_M 0x31 |
#define LSM303_TEMP_OUT_L_M 0x32 |
#define LSM303DLH_OUT_Y_H_M 0x05 |
#define LSM303DLH_OUT_Y_L_M 0x06 |
#define LSM303DLH_OUT_Z_H_M 0x07 |
#define LSM303DLH_OUT_Z_L_M 0x08 |
#define LSM303DLM_OUT_Z_H_M 0x05 |
#define LSM303DLM_OUT_Z_L_M 0x06 |
#define LSM303DLM_OUT_Y_H_M 0x07 |
#define LSM303DLM_OUT_Y_L_M 0x08 |
#define LSM303DLHC_OUT_Z_H_M 0x05 |
#define LSM303DLHC_OUT_Z_L_M 0x06 |
#define LSM303DLHC_OUT_Y_H_M 0x07 |
#define LSM303DLHC_OUT_Y_L_M 0x08 |
typedef enum { |
accGain_2 = 0x00, |
accGain_4 = 0x10, |
accGain_8 = 0x20, |
accGain_16 = 0x30 |
} accGain; |
typedef enum { |
magGain_13 = 0x20, |
magGain_19 = 0x40, |
magGain_25 = 0x60, |
magGain_40 = 0x80, |
magGain_47 = 0xA0, |
magGain_56 = 0xC0, |
magGain_81 = 0xE0 |
} magGain; |
void LSM303_Init(void); |
void LSM303_Set_Mag_Gain(magGain value); |
void LSM303_Read_Accl(char *x_L, char *x_H, |
char *y_L, char *y_H, |
char *z_L, char *z_H); |
void LSM303_Read_Magn(char *x_L, char *x_H, |
char *y_L, char *y_H, |
char *z_L, char *z_H); |
#endif /* LSM303_H */ |
//PIC Stuff/PICX_16F1829_BLE_IMU/TIMER.c |
---|
2,12 → 2,11 |
#include "main.h" |
#include "TIMER.h" |
char timer_2_pwm = 0; |
extern char LED_R_ON; |
extern char LED_G_ON; |
extern char LED_B_ON; |
void (*timer_1_callback)(void); |
void (*timer_2_callback)(void); |
void TIMER_1_Init(void) { |
void TIMER_1_Init(void (*callback)(void)) { |
timer_1_callback = callback; |
T1CONbits.TMR1CS = 2; // Clock source is ext oscillator |
T1CONbits.T1CKPS = 0; // Prescale of 1:1 |
T1CONbits.T1OSCEN = 1; // Dedicated oscillator circuit enabled |
28,15 → 27,17 |
} |
void TIMER_1_Interrupt_Handler(void) { |
timer_1_callback(); |
TMR1 = 0x8000; |
} |
void TIMER_2_Init(void) { |
T2CONbits.T2OUTPS = 0; // 1:1 Postscaler |
T2CONbits.TMR2ON = 0; // Timer stopped |
T2CONbits.T2CKPS = 0; // 1:1 Perscaler |
void TIMER_2_Init(void (*callback)(void)) { |
timer_2_callback = callback; |
T2CONbits.T2OUTPS = 0; // 1:1 Postscaler |
T2CONbits.TMR2ON = 0; // Timer stopped |
T2CONbits.T2CKPS = 0; // 1:1 Perscaler |
PIE1bits.TMR2IE = 1; // Timer 2 overflow interrupt |
PIE1bits.TMR2IE = 1; // Timer 2 overflow interrupt |
} |
void TIMER_2_Start(void) { |
48,22 → 49,5 |
} |
void TIMER_2_Interrupt_Handler(void) { |
// Here we manually 'PWM' the LEDs |
// Note: this is terribly inefficient but we need to do this |
// otherwise we will blow out the blue LED (max 10mA) |
if (timer_2_pwm == 0) { |
LED_R_LAT = (LED_R_ON) ? 0 : 1; |
LED_G_LAT = (LED_G_ON) ? 0 : 1; |
LED_B_LAT = (LED_B_ON) ? 0 : 1; |
} |
if (timer_2_pwm == LED_R_MAX_BRIGHTNESS) { |
LED_R_LAT = 1; |
} |
if (timer_2_pwm == LED_G_MAX_BRIGHTNESS) { |
LED_G_LAT = 1; |
} |
if (timer_2_pwm == LED_B_MAX_BRIGHTNESS) { |
LED_B_LAT = 1; |
} |
timer_2_pwm++; |
timer_2_callback(); |
} |
//PIC Stuff/PICX_16F1829_BLE_IMU/TIMER.h |
---|
1,12 → 1,13 |
#ifndef TIMER_H |
#define TIMER_H |
void TIMER_1_Init(void); |
void TIMER_1_Init(void (*callback)(void)); |
void TIMER_1_Start(void); |
void TIMER_1_Stop(void); |
void TIMER_1_Interrupt_Handler(void); |
void TIMER_2_Init(void); |
// Timer 2 is used to manually PWM the LED |
void TIMER_2_Init(void (*callback)(void)); |
void TIMER_2_Start(void); |
void TIMER_2_Stop(void); |
void TIMER_2_Interrupt_Handler(void); |
//PIC Stuff/PICX_16F1829_BLE_IMU/funclist |
---|
1,28 → 1,35 |
_TIMER_2_Init: CODE, 2037 0 9 |
_I2C_Get_Status: CODE, 4034 0 62 |
_I2C_Interrupt_Master: CODE, 52 0 706 |
_TIMER_2_Start: CODE, 3708 0 3 |
__stringtab: STRING, 2048 0 1 |
_I2C_Read_Buffer: CODE, 1863 0 72 |
__stringdata: STRING, 2049 0 15 |
_INTERRUPT_Init: CODE, 3705 0 3 |
_I2C_Interrupt_Slave: CODE, 758 0 424 |
_TIMER_2_Init: CODE, 3210 0 14 |
_I2C_Get_Status: CODE, 3578 0 62 |
_I2C_Interrupt_Master: CODE, 264 0 706 |
_TIMER_2_Start: CODE, 3171 0 3 |
_I2C_Read_Buffer: CODE, 3706 0 72 |
__i1fptable: CODE, 257 0 7 |
_INTERRUPT_Init: CODE, 3168 0 3 |
_I2C_Interrupt_Slave: CODE, 970 0 424 |
_INTERRUPT_Handler: CODE, 4 0 46 |
_I2C_Configure_Master: CODE, 2003 0 34 |
_I2C_Master_Send: CODE, 1620 0 83 |
_UART_Init: CODE, 3863 0 52 |
_main: CODE, 1399 0 126 |
_Error: CODE, 3915 0 57 |
_I2C_Process_Send: CODE, 3972 0 62 |
_I2C_Interrupt_Handler: CODE, 3739 0 26 |
_UART_TX_Interrupt_Handler: CODE, 3812 0 51 |
__initialization: CODE, 3717 0 19 |
_TIMER_2_Interrupt_Handler: CODE, 1935 0 68 |
_I2C_Master_Restart: CODE, 1784 0 79 |
_I2C_Init: CODE, 1525 0 95 |
_UART_RX_Interrupt_Handler: CODE, 1703 0 81 |
_Startup_Check: CODE, 1182 0 217 |
_UART_Write: CODE, 3765 0 47 |
_TIMER_1_Interrupt_Handler: CODE, 3 0 1 |
_I2C_Configure_Master: CODE, 3273 0 34 |
_I2C_Master_Send: CODE, 145 0 83 |
_UART_Init: CODE, 3407 0 52 |
_main: CODE, 1611 0 205 |
_Error: CODE, 3459 0 57 |
_TIMER_1_Init: CODE, 3224 0 23 |
_Timer_2_Callback: CODE, 3640 0 66 |
_I2C_Process_Send: CODE, 3516 0 62 |
_I2C_Interrupt_Handler: CODE, 3247 0 26 |
_UART_TX_Interrupt_Handler: CODE, 3356 0 51 |
__initialization: CODE, 2012 0 31 |
_TIMER_2_Interrupt_Handler: CODE, 3174 0 5 |
_I2C_Master_Restart: CODE, 3778 0 79 |
_LSM303_Init: CODE, 1816 0 101 |
_LSM303_Read_Accl: CODE, 52 0 93 |
_I2C_Init: CODE, 1917 0 95 |
_LSM303_Read_Magn: CODE, 3936 0 79 |
_Timer_1_Callback: CODE, 254 0 1 |
_UART_RX_Interrupt_Handler: CODE, 4015 0 81 |
_Startup_Check: CODE, 1394 0 217 |
_L3G_Init: CODE, 228 0 26 |
_UART_Write: CODE, 3307 0 49 |
_TIMER_1_Interrupt_Handler: CODE, 3191 0 9 |
_L3G_Read_Gyro: CODE, 3857 0 79 |
_INTERRUPT_Enable: CODE, 2046 0 2 |
Total: 2441 |
Total: 2943 |
//PIC Stuff/PICX_16F1829_BLE_IMU/main.c |
---|
5,6 → 5,8 |
#include "INTERRUPT.h" |
#include "UART.h" |
#include "I2C.h" |
#include "L3G.h" |
#include "LSM303.h" |
// <editor-fold defaultstate="collapsed" desc="Configuration Bits"> |
// CONFIG1 |
33,6 → 35,7 |
char LED_R_ON = 0; |
char LED_G_ON = 0; |
char LED_B_ON = 0; |
char timer_2_pwm = 0; |
void Error(char ID) { |
while(1) { |
120,6 → 123,39 |
} |
} |
void Timer_2_Callback(void) { |
// Here we manually 'PWM' the LEDs |
// Note: this is terribly inefficient but we need to do this |
// otherwise we will blow out the blue LED (max 10mA) |
if (timer_2_pwm == 0) { |
LED_R_LAT = (LED_R_ON) ? 0 : 1; |
LED_G_LAT = (LED_G_ON) ? 0 : 1; |
LED_B_LAT = (LED_B_ON) ? 0 : 1; |
} |
if (timer_2_pwm == LED_R_MAX_BRIGHTNESS) { |
LED_R_LAT = 1; |
} |
if (timer_2_pwm == LED_G_MAX_BRIGHTNESS) { |
LED_G_LAT = 1; |
} |
if (timer_2_pwm == LED_B_MAX_BRIGHTNESS) { |
LED_B_LAT = 1; |
} |
timer_2_pwm++; |
} |
void Timer_1_Callback(void) { |
// int A_X,A_Y,A_Z; |
// int G_X,G_Y,G_Z; |
// int M_X,M_Y,M_Z; |
// LSM303_Read_Accl(&A_X, &A_Y, &A_Z); |
// L3G_Read_Gyro(&G_X, &G_Y, &G_Z); |
// LSM303_Read_Magn(&output[6], &output[7], &output[8]); |
// UART_Write("Hello", 5); |
} |
int main() { |
OSCCON = 0xF0; // Software PLL enabled, 32MHz |
142,13 → 178,13 |
UART_RTS_LAT = 0; |
// Initialize all peripherals |
// TIMER_1_Init(); |
TIMER_2_Init(); |
TIMER_1_Init(&Timer_1_Callback); |
TIMER_2_Init(&Timer_2_Callback); |
UART_Init(&uart_data); |
I2C_Init(&i2c_data); |
INTERRUPT_Init(); |
I2C_Configure_Master(I2C_100KHZ); |
I2C_Configure_Master(I2C_400KHZ); |
INTERRUPT_Enable(); |
// TIMER_1_Start(); |
TIMER_2_Start(); |
156,22 → 192,37 |
// A small delay is needed for the sensors to start up |
__delay_ms(10); |
// Run a check to ensure that all sensors are properly connected |
Startup_Check(); |
// LED_R_ON = 1; |
// LED_G_ON = 1; |
// LED_B_ON = 1; |
// Initialze the sensors |
L3G_Init(); |
LSM303_Init(); |
char output[19] = {0}; |
output[18] = '\n'; |
LED_B_ON = 1; |
__delay_ms(3000); |
while(1) { |
UART_Write("Hello World \r\n", 14); |
LED_B_ON = 0; |
LED_R_ON = 1; |
__delay_ms(250); |
LED_R_ON = 0; |
LED_G_ON = 1; |
__delay_ms(250); |
LED_G_ON = 0; |
LED_B_ON = 1; |
__delay_ms(250); |
LSM303_Read_Accl(&output[0], &output[1], &output[2], &output[3], &output[4], &output[5]); |
L3G_Read_Gyro(&output[6], &output[7], &output[8], &output[9], &output[10], &output[11]); |
LSM303_Read_Magn(&output[12], &output[13], &output[14], &output[15], &output[16], &output[17]); |
UART_Write((char *)&output[0], 19); |
__delay_ms(10); |
// LED_B_ON = 0; |
// LED_R_ON = 1; |
// __delay_ms(250); |
// LED_R_ON = 0; |
// LED_G_ON = 1; |
// __delay_ms(250); |
// LED_G_ON = 0; |
// LED_B_ON = 1; |
// __delay_ms(250); |
} |
} |
//PIC Stuff/PICX_16F1829_BLE_IMU/nbproject/Makefile-default.mk |
---|
45,17 → 45,17 |
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} |
# Source Files Quoted if spaced |
SOURCEFILES_QUOTED_IF_SPACED=main.c TIMER.c INTERRUPT.c UART.c I2C.c |
SOURCEFILES_QUOTED_IF_SPACED=main.c TIMER.c INTERRUPT.c UART.c I2C.c L3G.c LSM303.c |
# Object Files Quoted if spaced |
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/main.p1 ${OBJECTDIR}/TIMER.p1 ${OBJECTDIR}/INTERRUPT.p1 ${OBJECTDIR}/UART.p1 ${OBJECTDIR}/I2C.p1 |
POSSIBLE_DEPFILES=${OBJECTDIR}/main.p1.d ${OBJECTDIR}/TIMER.p1.d ${OBJECTDIR}/INTERRUPT.p1.d ${OBJECTDIR}/UART.p1.d ${OBJECTDIR}/I2C.p1.d |
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/main.p1 ${OBJECTDIR}/TIMER.p1 ${OBJECTDIR}/INTERRUPT.p1 ${OBJECTDIR}/UART.p1 ${OBJECTDIR}/I2C.p1 ${OBJECTDIR}/L3G.p1 ${OBJECTDIR}/LSM303.p1 |
POSSIBLE_DEPFILES=${OBJECTDIR}/main.p1.d ${OBJECTDIR}/TIMER.p1.d ${OBJECTDIR}/INTERRUPT.p1.d ${OBJECTDIR}/UART.p1.d ${OBJECTDIR}/I2C.p1.d ${OBJECTDIR}/L3G.p1.d ${OBJECTDIR}/LSM303.p1.d |
# Object Files |
OBJECTFILES=${OBJECTDIR}/main.p1 ${OBJECTDIR}/TIMER.p1 ${OBJECTDIR}/INTERRUPT.p1 ${OBJECTDIR}/UART.p1 ${OBJECTDIR}/I2C.p1 |
OBJECTFILES=${OBJECTDIR}/main.p1 ${OBJECTDIR}/TIMER.p1 ${OBJECTDIR}/INTERRUPT.p1 ${OBJECTDIR}/UART.p1 ${OBJECTDIR}/I2C.p1 ${OBJECTDIR}/L3G.p1 ${OBJECTDIR}/LSM303.p1 |
# Source Files |
SOURCEFILES=main.c TIMER.c INTERRUPT.c UART.c I2C.c |
SOURCEFILES=main.c TIMER.c INTERRUPT.c UART.c I2C.c L3G.c LSM303.c |
CFLAGS= |
118,6 → 118,22 |
@-${MV} ${OBJECTDIR}/I2C.d ${OBJECTDIR}/I2C.p1.d |
@${FIXDEPS} ${OBJECTDIR}/I2C.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ |
${OBJECTDIR}/L3G.p1: L3G.c nbproject/Makefile-${CND_CONF}.mk |
@${MKDIR} ${OBJECTDIR} |
@${RM} ${OBJECTDIR}/L3G.p1.d |
@${RM} ${OBJECTDIR}/L3G.p1 |
${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G -D__DEBUG=1 --debugger=pickit3 --double=24 --float=24 --opt=default,+asm,-asmfile,+speed,-space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf "--errformat=%%f:%%l: error: %%s" "--warnformat=%%f:%%l: warning: %%s" "--msgformat=%%f:%%l: advisory: %%s" -o${OBJECTDIR}/L3G.p1 L3G.c |
@-${MV} ${OBJECTDIR}/L3G.d ${OBJECTDIR}/L3G.p1.d |
@${FIXDEPS} ${OBJECTDIR}/L3G.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ |
${OBJECTDIR}/LSM303.p1: LSM303.c nbproject/Makefile-${CND_CONF}.mk |
@${MKDIR} ${OBJECTDIR} |
@${RM} ${OBJECTDIR}/LSM303.p1.d |
@${RM} ${OBJECTDIR}/LSM303.p1 |
${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G -D__DEBUG=1 --debugger=pickit3 --double=24 --float=24 --opt=default,+asm,-asmfile,+speed,-space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf "--errformat=%%f:%%l: error: %%s" "--warnformat=%%f:%%l: warning: %%s" "--msgformat=%%f:%%l: advisory: %%s" -o${OBJECTDIR}/LSM303.p1 LSM303.c |
@-${MV} ${OBJECTDIR}/LSM303.d ${OBJECTDIR}/LSM303.p1.d |
@${FIXDEPS} ${OBJECTDIR}/LSM303.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ |
else |
${OBJECTDIR}/main.p1: main.c nbproject/Makefile-${CND_CONF}.mk |
@${MKDIR} ${OBJECTDIR} |
159,6 → 175,22 |
@-${MV} ${OBJECTDIR}/I2C.d ${OBJECTDIR}/I2C.p1.d |
@${FIXDEPS} ${OBJECTDIR}/I2C.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ |
${OBJECTDIR}/L3G.p1: L3G.c nbproject/Makefile-${CND_CONF}.mk |
@${MKDIR} ${OBJECTDIR} |
@${RM} ${OBJECTDIR}/L3G.p1.d |
@${RM} ${OBJECTDIR}/L3G.p1 |
${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G --double=24 --float=24 --opt=default,+asm,-asmfile,+speed,-space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf "--errformat=%%f:%%l: error: %%s" "--warnformat=%%f:%%l: warning: %%s" "--msgformat=%%f:%%l: advisory: %%s" -o${OBJECTDIR}/L3G.p1 L3G.c |
@-${MV} ${OBJECTDIR}/L3G.d ${OBJECTDIR}/L3G.p1.d |
@${FIXDEPS} ${OBJECTDIR}/L3G.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ |
${OBJECTDIR}/LSM303.p1: LSM303.c nbproject/Makefile-${CND_CONF}.mk |
@${MKDIR} ${OBJECTDIR} |
@${RM} ${OBJECTDIR}/LSM303.p1.d |
@${RM} ${OBJECTDIR}/LSM303.p1 |
${MP_CC} --pass1 $(MP_EXTRA_CC_PRE) --chip=$(MP_PROCESSOR_OPTION) -Q -G --double=24 --float=24 --opt=default,+asm,-asmfile,+speed,-space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf "--errformat=%%f:%%l: error: %%s" "--warnformat=%%f:%%l: warning: %%s" "--msgformat=%%f:%%l: advisory: %%s" -o${OBJECTDIR}/LSM303.p1 LSM303.c |
@-${MV} ${OBJECTDIR}/LSM303.d ${OBJECTDIR}/LSM303.p1.d |
@${FIXDEPS} ${OBJECTDIR}/LSM303.p1.d $(SILENT) -rsi ${MP_CC_DIR}../ |
endif |
# ------------------------------------------------------------------------------------ |
//PIC Stuff/PICX_16F1829_BLE_IMU/nbproject/Makefile-genesis.properties |
---|
1,5 → 1,5 |
# |
#Tue Sep 24 21:44:35 EDT 2013 |
#Sat Sep 28 01:14:49 EDT 2013 |
default.languagetoolchain.dir=C\:\\Program Files (x86)\\Microchip\\xc8\\v1.20\\bin |
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=0d2b1469ad71adb787c711a416386331 |
default.languagetoolchain.version=1.20 |
//PIC Stuff/PICX_16F1829_BLE_IMU/nbproject/configurations.xml |
---|
9,6 → 9,8 |
<itemPath>INTERRUPT.h</itemPath> |
<itemPath>UART.h</itemPath> |
<itemPath>I2C.h</itemPath> |
<itemPath>L3G.h</itemPath> |
<itemPath>LSM303.h</itemPath> |
</logicalFolder> |
<logicalFolder name="LinkerScript" |
displayName="Linker Files" |
22,6 → 24,8 |
<itemPath>INTERRUPT.c</itemPath> |
<itemPath>UART.c</itemPath> |
<itemPath>I2C.c</itemPath> |
<itemPath>L3G.c</itemPath> |
<itemPath>LSM303.c</itemPath> |
</logicalFolder> |
<logicalFolder name="ExternalFiles" |
displayName="Important Files" |