Forum Replies Created
-
AuthorPosts
-
July 8, 2011 at 4:09 am in reply to: How to output data to 8051 microcontroller by the USB port of a PC with any program language????? #6435romel emperadoParticipant
you cannot use USB in an old 8051 because it has no USb module… go with PIC18fxx series..
July 8, 2011 at 4:08 am in reply to: how we can extract sms recieved by microcontroller8051 and use for switching #6434romel emperadoParticipantbrowse the tutorial about serial in this forum .. the UART code is already there..
if you are using any modem for the communication then study the manual of that modem of supported AT commands..
romel emperadoParticipantif you dont want to receive sms then just use any available timer in you controller..
measure 15m delay then tel your serial interrupt to send the msg every 15m
romel emperadoParticipantMCP3201 is a SPI baded ADC..
you need to use SPI protocol for that…
read about SPI and dont forget to read the datasheet of that adc the intrucstion on how to interface that to the controller is in the ADC datasheet..
romel emperadoParticipantThe best thing you can do is to setup serial interrupt..
no need of waiting 15m when the msg is comming.. serial interrupt will just wait the msg u want serially and run continously in the backgroun if there is no msg…
romel emperadoParticipantfirst you need to enable PORTA as input by changing the value of CMCON register.. check the datasheet of your device.
your conditional statement is inside the while(1) loop, so if you release you button the value of the port will change and it will not satisfy your needs.. put also a pull down resistor to your input so that will toggle to 1 when the button is pressed.
just make a flag that the button is pressed.. do it like this
#include<htc.h> // you dont need to include pic.h when htc.h is there..
// dont forget to set the proper configuration bits.
void main()
{
bit x = 0, y= 0;;
//your I/0 initiallization here// dont forget to set CMCON
while(1)
{
if(RA0 == 1)
x = 1; //set as flag when RA0 is high
if(RA1 == 1)
y = 1;
if(x == 1)
{
//led is on
//relay is on
// put your delay here
x= 0; //clear your flag
}
if(y == 1)
{
//led is off
//relay is off
// put your delay here
y= 0; //clear your flag
}
}}
romel emperadoParticipantAT commands if for the modem and not for 8051..
AT comamnds are based on what model of modem you have.. get the manual of your modem then you will know everything about At commands
romel emperadoParticipantif the code is accessing registers that is not available with the other PIC then it will not work.. better check the code if what is in there then compare..
romel emperadoParticipanthi rajsekhar nag,
the value if sbuf is any data received from serial input or the RX pin..
read about serial communication of 8051..
romel emperadoParticipantwhat are you trying to do with DB9?
anyway if you are looking with connections of DB9 a simple google search will give you this
romel emperadoParticipantsensors are treated as INPUT devices.. and that chip you are referring to is for an output device….
romel emperadoParticipantthats not a sensor circuit.. that is only relay driver chip.. your sensor will not gonna work if you just connect directly in that chip.. go search a sensor circuit in google of your choice.
May 17, 2011 at 9:39 pm in reply to: Plz again helpe to understand programe for digital clock using seven segment #6260romel emperadoParticipantdig_disp++; // variable is increamented
dig_disp=dig_disp%4; // as u can see this line using modulo any value
switch(dig_disp)
dig_disp=dig_disp%4; // as u can see this line is using modulo any value of this variable will be check by the switch case..
this is simply getting the timing if you want faster timing you can change that in 2 instead of 4..
try to experiment so that will know what happens if you change that line..
romel emperadoParticipantfirst you need to find a sensor circuit you want whatever it is..
understand the circuit how it works. it should have a digital output that will trigger the input of your parallel port for the program to know that the sensor senses something unusual.
example your have smoke detector circuit… when the sensor does not sense any smoke at all the output of the smoke sensor circuit is 0 or logic low and if smoke is sensed then it will trigger to logic high og 1.. thats all.. actually you need only 2 wires to do that exluding the power lines.
romel emperadoParticipantyou can do that.. just input a digital signal to parallel port when fire is present..
let say the port by default is logic low then if fire is present then it will turn to logic high
-
AuthorPosts