Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ ASM
hello. i have to do a project about GSM, for feeding fish system. But i have a problem to make PIC Coding for feeding system to send output for GSM modem. I decide to use PIC16F877A. please anyone help me to construct the coding....
Posted 2-May-12 17:40pm
jje1284315
Comments
Mohibur Rashid at 2-May-12 23:56pm
   
C++ with pic? are you sure?
Mohibur Rashid at 2-May-12 23:58pm
   
by the way did you decide how it would work?
jje1284 at 3-May-12 0:17am
   
can use the ASM? firstly, im using sensor to detect food level,then sensor send the output to PIC. there are 4 level food in the feeder. when the max level detect 0, which means no food at max level, so it will send output to PIC. then PIC will send data/output to GSM modem. so that GSM can send a message to the owner.
pwasser at 3-May-12 1:48am
   
Check out Arduino

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Assuming your GSM modem has a serial port, connect it to the USART port pins of the PIC using a RS-232 level shifter.
 
Read the various Microchip application notes with souce code examples about the usage of the USART port.
 
Modems (including GSM modems) are controlled by text commands (AT command set). See the data sheet of your modem.
 
Finally implement the modem communication by programming functions that read and write strings from/to the USART port.
 
You may use a C compiler to generate the code for your PIC device. However, many PIC devices have only a few bytes of RAM (like yours with 368 bytes). Therefore, it is often better to use assembler code. In your case, you have to reserve memory to hold the longest possible answer from the modem or implement code that can decode answers during receive.
 
If you only want to send short messages (SMS), using the PIC devive may be realizable (don't forget that you must also initialize the modem). With longer messages or when you want to send emails via the modem, using a small embedded device would be a better solution.
  Permalink  
Comments
CPallini at 3-May-12 4:39am
   
My 5.
jje1284 at 3-May-12 6:11am
   
Jochen Arndt...can you help me to construct the coding for PIC? i am very weak in programming...
Jochen Arndt at 3-May-12 7:17am
   
If you have a specific problem with your existing code, I and others here may help you. But nobody here will do your job. In your case, development requires the hardware to be present for testing and debugging.
 
If you have no experience with writing code for Microchip controllers, I suggest to start with an evaluation board and use some of the example applications for that board to become familiar with PIC controllers. See the PICkit2 Debug Express kit at http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en023805. It includes a board with a 16F887 controller.
jje1284 at 3-May-12 8:11am
   
i have the existing code but im used with the PIC16F84A. it is just the basic right. so can i edit the code to use in PIC16F877A??
Jochen Arndt at 3-May-12 9:16am
   
With PIC controllers, code can be ported for devices from the same family (same command set). But you must take care about the memory locations (especially when using ASM). You must compare the data sheets to find the differences. You should also consider to switch to the 16F887 (the 16F877 is not recommended for new designs).
jje1284 at 3-May-12 11:57am
   
what do you mean by 16F877 is not recommended for new designs?
Jochen Arndt at 3-May-12 12:09pm
   
It is not listed in the PIC16 overview list on the Microchip web site and the web site of it contains a note to use the 16F887. See on top of http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010242. In the past these indicates that the device may be go out of production in the near future. See also the PDF link to the PIC16F87XA-PIC16F88X Migration document on that site. It contains useful information on porting code between different PIC devices.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 454
1 Maciej Los 404
2 CPallini 185
3 Sergey Alexandrovich Kryukov 182
4 Richard MacCutchan 120
0 OriginalGriff 5,634
1 Sergey Alexandrovich Kryukov 4,763
2 Peter Leow 2,954
3 Maciej Los 2,614
4 DamithSL 2,465


Advertise | Privacy | Mobile
Web01 | 2.8.140718.1 | Last Updated 3 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid