Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] PIC16F628A Program Troubleshooting

Status
Not open for further replies.

sribangaram

Full Member level 5
Joined
Apr 29, 2012
Messages
297
Helped
7
Reputation
14
Reaction score
7
Trophy points
1,298
Location
INDIA.:/;:'" VIJAYAWADA
Activity points
3,754
Dear friends I need help for pic 16f 628a program side please check the program i want to add "2" digital inputs for switching and "2" digital out puts and one more sms out please help me
 

Attachments

  • Interfacing_GSM_Module_with_PIC (1).rar
    17.9 KB · Views: 55

friends please check my program


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//GSM interfacing with PIC16f628A
//Developed by i-St@r Electronics
//www.circuitsgalley.com
void send_sms()
{
      Uart1_Write_TEXT("AT\r");
      Uart1_Write('\n');
      Delay_ms(1000);
      Uart1_Write_TEXT("AT+CMGF=1\r");
      Uart1_Write('\n');
 
     Uart1_Write_TEXT("AT+CMGS="9544094745"\r");
     Uart1_Write('\n');
     Uart1_Write_TEXT("Hello\r");
     Uart1_Write_TEXT("i-St@r\r");
     Uart1_Write('\n');
     Uart1_Write(26);
       }
       
void call()
{
      Uart1_Write_TEXT("AT\r");
      Uart1_Write('\n');
      Delay_ms(1000);
      Uart1_Write_TEXT("ATD9544094745;\r");
      Uart1_Write('\n');
      Delay_ms(5000);
}
 
void main()
{
TRISB.F0=0;
TRISB.F1=1;
TRISB.F2=0;
TRISB.F3=1;
TRISB.F4=1;
TRISB.F5=0;
TRISB.F6=0;
PORTB.F0=0;
PORTB.F2=0;
PORTB.F5=0;
PORTB.F6=0;
 
Uart1_init(9600);
Delay_ms(5000);
Uart1_Write_TEXT("AT\r");
Uart1_Write(13);
Uart1_Write(10);
Delay_ms(1000);
Uart1_Write_TEXT("AT+CMGF=1\r");
Uart1_Write(13);
Uart1_Write(10);
Delay_ms(1000);
Uart1_Write_TEXT("AT+CNMI=2,2,0,0,0\r");
Uart1_Write(13);
Uart1_Write(10);
Delay_ms(3000);
PORTB.F6=1;
while(1)
{
        if(PORTB.F3==0)
        {
        PORTB.F0=1;
        call();
        Delay_ms(6000);
        PORTB.F0=0;
        }
 
        if(PORTB.F4==0)
        {
        PORTB.F5=1;
        send_sms();
        Delay_ms(2000);
        PORTB.F5=0;
        }
 
}
 
}



Now i want to add "2" in puts and "2" out puts and one more sms Chanel
 
Last edited by a moderator:

Change
Code:
"AT+CMGS="9544094745"\r"
to
Code:
"AT+CMGS="9544094745"\r"
If you provide the circuit I will write a code for you. Also I want to know the actual SMS that you will send because that will be stored in ROM as RAM is less.
 
yes friend when in put "1" getting high out put relay want yo be "ON" some time may be one or two minits and same Input "2" getting high same out relay "ON" and same time Alredy gsm modem call function and sms function working is good

- - - Updated - - -

Actually running circuit is Interfacing_GSM_Moudle_SIM300_with_PIC16f628_circuit_diagram.png

Now i want add my requirement
 

Here is the working project. If you need any changes then mention it.
 

Attachments

  • Relay and SMS.rar
    81.5 KB · Views: 52
Friend already IC pins 9 & 10 pins in Call and sms switches
pin 6 & 11 are call and sms indication
once please check my circuit diagram in #6 thread
 

I have included Proteus file. Check the simulation and tell me what exact changes you want and also mention when the 3 LEDs have to turn ON or OFF. Also zip and post your Proteus file.
 
Friend Please let me understand My old circuit working
the IC PIN 12 TO LED Means ready indication
IC PIN 9 TO SWITCH Means Calling when press the switch will go to Call reference number
IC PIN 6 TO LED Means call switch indication
IC PIN 10 TO SWITCH Means SMS when press the switch will go to SMS reference number
IC PIN 11 TO LED Means SMS switch indication
IC PN 7&8 gsm TX & RX
IC PIN 15& 16 CRYSTAL 20 MHz
TILL NOW WORKING IS GOOD NOTHING ISSUE


Now i want to Adding two more switches when i have to press the switch out put relay will be active in reference time

please excuse me my poor english
 

You didn't mention when the LEDs has to turn ON and when they have to turn OFF. Modify my Proteus file and zip and post it here. I will make changes to the code. I have used Proteus 8.2 SP2. Old versions will not open the file.
 

There is a .pdsprj file in my attachment. It is Proteus file used for Simulation. As you don't have Proteus I will make the necessary changes. Just tell when the LEDs have to turn ON and for how long time and also when they have to turn OFF. Also mention for how long the relays has to be ON before turning OFF.
 

friend I am telling you simple I want to connect 17 and 1 ic pins latch mode switch's
ic pins 18 and 2 gose to relays when i have to 17 or 1 switch's will be on ( it's not mum entry latch mode its cantinue in on mode) 18 and 2 pins give to out put in reference of time when again that switch's will off and on and want to same job
 

Try the attached .hex file in hardware and reply. I have compiled the code for 4 MHz. If your clock frequency is different then compile the code for that frequency and test.
 

Attachments

  • Relay and SMS rev1.rar
    80.2 KB · Views: 62

Friend nothing work hardware connection is in yours attechment

- - - Updated - - -

friend modem also not giving commends
 

This is the circuit you have to build.
 

Attachments

  • schematic.png
    schematic.png
    42.8 KB · Views: 65

I have tested it in Proteus and it is working. What Clock frequency are you using ?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top