- This topic has 1 reply, 2 voices, and was last updated 10 years, 10 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › PIC › Picbasic pro program to interface compim in proteus not working
Hi all, im building a project using two pic microcontrollers on as a receiver and one as a transmitter.These two microcontrollers are connected wirelessly using xbee.After the receiver pic recieves a signal from the transmitter an alarm is sounded, a message is displayed on the LCD and also a text mesage via a SIM300 GSM MODULE to a phone number.I am using compim to act as xbee and gsm module in proteus.My problem is my pic both have just one serial port,i need two i tried to create a software uart but failed, also how do i know my compim is working well?Can anyone help me out please,,,,
Below is my code
Transmitter pic code in pic basic pro
INCLUDE “modedefs.BAS”
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 6
DEFINE DEBUG_BAUD 9600
define DEBUG_MODE 0
‘set up adc parameters
trisB= %00010010
trisA= %11111111
S1 VAR PORTB.4
IF S1=0 THEN
goto WIRELESS
WIRELESS:
HIGH S0
SEROUT portb.2,T9600,[“1”]
ENDIF
Receiver pic code
INCLUDE “modedefs.BAS”
DEFINE DEBUG_REG PORTC
DEFINE DEBUG_BIT 7
DEFINE DEBUG_BAUD 9600
define DEBUG_MODE 0
TRISC=%10000100
X2 VAR PORTC.7
SERIN X2,T9600,[ (“1”),rec]
if (rec == 1) THEN
SOUND PORTA.0,[100,10,60,15,120,10,73,10,120,10]
ENDIF
Hi Steohane,
Suggest you not to waste your time and restrict yourself on any simulation software. Start doing things in real hardware and you will find N number of debugging methods and solutions to make things work.