This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <p18f4553.h> | |
#include "task_led.h" | |
#include "timer0.h" | |
//****************************************************************************** | |
// CONFIG | |
//****************************************************************************** | |
#pragma config PLLDIV = 5 // (20 MHz crystal on PICDEM FS USB board) | |
#pragma config CPUDIV = OSC1_PLL2 | |
#pragma config USBDIV = 2 // Clock source from 96MHz PLL/2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "1wire.h" | |
void OW_DriveLow(void); | |
void OW_DriveHigh(void); | |
void OW_WriteBit(unsigned char OW_data_bit); | |
void OW_DriveLow(void) | |
{ | |
OW_PIN_DIRECTION=OW_OUTPUT; | |
OW_WRITE_PIN=0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef DELAY_H_ | |
#define DELAY_H_ | |
#include <delays.h> | |
#define delay1MicroSecond() {Delay10TCYx(1); Delay1TCY(); Delay1TCY();} | |
#define delay5MicroSecond() Delay10TCYx(6) | |
#define delay10MicroSecond() Delay10TCYx(12) | |
#define delay50MicroSecond() Delay10TCYx(60) | |
#define delay100MicroSecond() Delay100TCYx(12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef DELAY_H_ | |
#define DELAY_H_ | |
#include <delays.h> | |
#define delay1MicroSecond() {Delay10TCYx(1); Delay1TCY(); Delay1TCY();} | |
#define delay5MicroSecond() Delay10TCYx(6) | |
#define delay10MicroSecond() Delay10TCYx(12) | |
#define delay50MicroSecond() Delay10TCYx(60) | |
#define delay100MicroSecond() Delay100TCYx(12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef DELAY_H_ | |
#define DELAY_H_ | |
#include <delays.h> | |
#define delay1MicroSecond() {Delay10TCYx(1); Delay1TCY(); Delay1TCY();} | |
#define delay5MicroSecond() Delay10TCYx(6) | |
#define delay10MicroSecond() Delay10TCYx(12) | |
#define delay50MicroSecond() Delay10TCYx(60) | |
#define delay100MicroSecond() Delay100TCYx(12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************** | |
FileName: HardwareProfile - PIC SK40C.h | |
Dependencies: See INCLUDES section | |
Processor: PIC18 USB Microcontrollers | |
Hardware: PIC SK40C | |
Compiler: Microchip C18 | |
Company: CYTAN. | |
******************************************************************** | |
File Description: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "delay.h" | |
void delayMicroSecond (unsigned int time) | |
{ | |
while (time--) | |
{ | |
_delay_cycles(MICRO_SECOND); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "delay.h" | |
void delayMicroSecond (unsigned int time) | |
{ | |
while (time--) | |
{ | |
_delay_cycles(MICRO_SECOND); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "delay.h" | |
void delayMicroSecond (unsigned int time) | |
{ | |
while (time--) | |
{ | |
_delay_cycles(MICRO_SECOND); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <msp430.h> | |
/* | |
* main.c | |
*/ | |
#define DIR_PIN 0x01 | |
#define STEP_PIN 0x02 | |
#define FORWARD 0x01 |