Sorry if this is not the place to write but here it goes.
Story: I'm working at a small to medium size company where we sell interphones and security devices (burglar systems, CCTV equipment, etc). Some of these interphones comes with PIC 16F57 microcontrollers which, depending on customer requirement, i switch the number of digits and number of seconds, for unlocking the door, by programming the microcontroller with already defined .hex files which we got from the manufacturer.
I'm doing this using PICKIT 3 and just importing them to the microcontroller.
Lately, some of our customers, asked if we can provide some "easy and cheap to implement" devices to control the timing of their interphones. Some of them need more than 1-8 seconds provided by factory settings of our interphones, not just for unlocking the door, but to control lights and other stuff.
These people dont want to invest another 50-100 dollars into an equipment that does that, so they are asking me if i have a solution for some extra bucks.
This basically was my excuse to dig deep into the idea of controlling relays and LED's which i kinda wanted for some time.
For the last couple of weeks i spent hours and hours searching on the internet on how to do simple commands using pic microcontroller, but i made almost no improvement so far.
So, i'm asking you guys if you could help me with some information, or links where i can learn to work with PIC16f57
The reason why i chosen PIC16F57 is because i have huge supply of them at the office. Any other model of microcontroller would be hard to get by.
Keep in mind, i'm a total noob when it comes to microcontrollers and programming (in any language).
What i've done so far was making a LED blink, 2 sec on, 2 sec off.
Equipment: Pickit 3
Software: MPLAB X IDE with xc8 compiler, and pickit 3 standalone programmer (i use pickit 3 standalone programmer instead of mplab to program the microcontroller because i cant do it with mplab)
What i'm trying to do: using an input (a simple switch) to turn on a relay(or LED) for 30 minutes more or less.
This is my code for my blinking LED which was succesful.
I'm gonna attach a schematic with my working blinking LED just to see what kind of connections i made.
I've seen plenty of examples but for other pic microcontrollers which didn't worked or implement in my case.
Story: I'm working at a small to medium size company where we sell interphones and security devices (burglar systems, CCTV equipment, etc). Some of these interphones comes with PIC 16F57 microcontrollers which, depending on customer requirement, i switch the number of digits and number of seconds, for unlocking the door, by programming the microcontroller with already defined .hex files which we got from the manufacturer.
I'm doing this using PICKIT 3 and just importing them to the microcontroller.
Lately, some of our customers, asked if we can provide some "easy and cheap to implement" devices to control the timing of their interphones. Some of them need more than 1-8 seconds provided by factory settings of our interphones, not just for unlocking the door, but to control lights and other stuff.
These people dont want to invest another 50-100 dollars into an equipment that does that, so they are asking me if i have a solution for some extra bucks.
This basically was my excuse to dig deep into the idea of controlling relays and LED's which i kinda wanted for some time.
For the last couple of weeks i spent hours and hours searching on the internet on how to do simple commands using pic microcontroller, but i made almost no improvement so far.
So, i'm asking you guys if you could help me with some information, or links where i can learn to work with PIC16f57
The reason why i chosen PIC16F57 is because i have huge supply of them at the office. Any other model of microcontroller would be hard to get by.
Keep in mind, i'm a total noob when it comes to microcontrollers and programming (in any language).
What i've done so far was making a LED blink, 2 sec on, 2 sec off.
Equipment: Pickit 3
Software: MPLAB X IDE with xc8 compiler, and pickit 3 standalone programmer (i use pickit 3 standalone programmer instead of mplab to program the microcontroller because i cant do it with mplab)
What i'm trying to do: using an input (a simple switch) to turn on a relay(or LED) for 30 minutes more or less.
This is my code for my blinking LED which was succesful.
Code:
#pragma config OSC = HS // Oscillator selection bits (HS oscillator)
#pragma config WDT = ON // Watchdog timer enable bit (WDT enabled)
#pragma config CP = OFF // Code protection bit (Code protection off)
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
#include <xc.h>
#define _XTAL_FREQ 12000000
void main(void) {
TRISB = 0x00;
while(1){
PORTB = 0xFF;
__delay_ms(2000);
PORTB = 0x00;
__delay_ms(2000);
}
}
I've seen plenty of examples but for other pic microcontrollers which didn't worked or implement in my case.
Attachments
-
80.1 KB Views: 16