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] Picbasic pro program to interface compim in proteus not working

Status
Not open for further replies.

stephansbest

Newbie level 4
Joined
Jan 28, 2014
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
53
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,,,,:sad::sad::sad::cry::cry::cry::cry::cry:
 

Me personally would not use proteus for this as from experience it works well in proteus but in real time you have issue's with timing etc, you would be best off building it and testing it real time, There are some pics' that have 2 uarts like the 18f25k22 see here it may help
**broken link removed**
 

Thank you wizpic
i am behind schedule and i have already purchased pic 16f877a and 16f628a for the project. Is there any way i can do this,,,how the two pics can communicate wirelessly via the xbee... im using the serin and serout commands for this but they arent coommunicating still
 

Sounds like you have timing issues are you sending preamble a few $55 at the begining
Post your code as you may get more help are you using PDS or mellabs picbasic ?
 

Hi iam writing my progrAM USING pic basic pro,please see below a portion of my code
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 s3,T9600,[ ("1"),rec]
if (rec == 1) THEN
SOUND PORTA.0,[100,10,60,15,120,10,73,10,120,10]
ENDIF
Transmitter PIC CODE
Code:
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT  6
DEFINE DEBUG_BAUD 9600
define DEBUG_MODE 0
'set up adc parameters
DEFINE ADC_BITS      10
DEFINE ADC_CLOCK     3
DEFINE ADC_SAMPLEUS 50
trisA=  %11111111 
ADCON1= 0
ADCON0= %11000001
S1 VAR PORTB.4
IF S1=0 THEN
goto WIRELESS
WIRELESS:
HIGH S0
SEROUT S0,T9600,["1"]
ENDIF

THANK YOU

- - - Updated - - -

pic communication.JPG
This is my design in proteus fro the picbasic pro code
 
Last edited by a moderator:

Looking at your code you have no wait in the ser command this means once it as been missed it just sits there and it stays locked in a loop and at a quick glance I see lots of errors but I don't really use picbasic pro I use PDS and on their site a user posted RF code that works really well without using ser command which is hard work
Have you tried here and searched
https://www.picbasic.co.uk/forum/forum.php?
This may help
https://www.picbasic.co.uk/forum/showthread.php?t=12554

This should give you an idea, also looking at you picture I take it you have got 2 virtual serial ports set up on your computer so they can talk to each other also you can add virtual terminals to see what is been transmitted and received

also you don't need to keep sending me PM'S as to what you have posted here I can see when I log in and sending PM'S for help is not best practice others will not know the progress
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top