Find Jobs
Hire Freelancers

pic microcontroller

$15-20 USD

Closed
Posted almost 19 years ago

$15-20 USD

Paid on delivery
The aim of the project is to wireless transmission of data from one PIC16f877 to another [login to view URL] data must be encoded and then transmitted by a transmitter. At the receiving end the receiving antenna receives the modulated data and demodulates the data and then decodes it. I have the transmitter part of the code working and am attaching it but have a problem with the receiver part. ## Deliverables 11.1 Source code at the transmitter end PIC ;****************************************************** ;[login to view URL] Encodes the Input data CountOuter0 equ D'75' CountInner0 equ D'25' CountOuter1 equ D'10' CountInner1 equ D'125' CountOuter2 equ D'25' CountInner2 equ D'25' INPUT equ B'10010010' cblock 0x20 CountOuter CountInner number endc ;****************************************************** list p=16f877 include "[login to view URL]" org 0x00 nop goto Main org 0x04 ;****************************************************** ;2.5ms delay subroutine DELAY1 movlw CountOuter2 movwf CountOuter DecO1 movlw CountInner2 movwf CountInner DecI1 nop decfsz CountInner, F goto DecI1 decfsz CountOuter, F goto DecO1 return ;5ms delay subroutine DELAY2 movlw CountOuter1 movwf CountOuter DecO2 movlw CountInner1 movwf CountInner DecI2 nop decfsz CountInner, F goto DecI2 decfsz CountOuter, F goto DecO2 return ;7.5ms delay subroutine DELAY3 movlw CountOuter0 movwf CountOuter DecO3 movlw CountInner0 movwf CountInner DecI3 nop decfsz CountInner, F goto DecI3 decfsz CountOuter, F goto DecO3 return Main ;banksel TRISA ;Select Bank1 ; movlw B'00000001' ;Trans starts when RA0 high ;movwf TRISA banksel TRISB clrf TRISB ;PORTB is output banksel PORTA ; clrf PORTA ;clear PORTA clrf PORTB ;clear PORTB BEGIN ;btfsc PORTA,0 ;goto BEGIN banksel number movlw INPUT movwf number banksel PORTB bcf PORTB,0 call DELAY1 bsf PORTB,0 ;Transmit START call DELAY3 ;wait 7.5ms TESTA0 bcf PORTB,0 ;Transmit Space call DELAY1 ;wait 2.5ms banksel number btfsc number,0 ;Test number,0 goto SETA0 ;If number=1 goto CLRA0 ;If number=0 SETA0 banksel PORTB bsf PORTB,0 ;Transmit 1 call DELAY2 ;wait 5ms goto TESTA1 CLRA0 bsf PORTB,0 ;Transmit 0 call DELAY1 ;wait 2.5ms TESTA1 bcf PORTB,0 call DELAY1 banksel number btfsc number,1 goto SETA1 goto CLRA1 SETA1 banksel PORTB bsf PORTB,0 call DELAY2 goto TESTA2 CLRA1 bsf PORTB,0 call DELAY1 TESTA2 bcf PORTB,0 call DELAY1 banksel number btfsc number,2 goto SETA2 goto CLRA2 SETA2 banksel PORTB bsf PORTB,0 call DELAY2 goto TESTA3 CLRA2 bsf PORTB,0 call DELAY1 ........and so on for A3,A4,A5,A6 AND TESTA7 bcf PORTB,0 call DELAY1 banksel number btfsc number,7 goto SETA7 goto CLRA7 SETA7 banksel PORTB bsf PORTB,0 call DELAY2 clrf PORTB goto BEGIN CLRA7 bsf PORTB,0 call DELAY1 clrf PORTB goto BEGIN end Data encoding using PIC 16F877 The raw data must be in some standard format to be transmitted over a wireless channel so it must be encoded first before transmitting. The encoding is achieved using PIC 16F877. A start pulse of logic high with duration 7.5 ms is sent first before sending the actual data to ensure that transmission is started. If the bit of the Input data is logic 1 then pulse of logic high with duration of 5 ms is sent and if the Input bit is logic 0 then the pulse of logic high with duration of 2.5 ms is sent. After every input bit a pulse of duration 2.5 ms with logic low is sent. PORTB, 0th bit is used as the output of the encoded data. This means if the Input data sequence is 10101010, then the voltage on RB0 is kept high for 5 ms (1) then low for 2.5 ms again high for 2.5 ms (0) and so on for all the 8 bits. The RB0 pin is connected to the transmitter input; the transmitter modulated the encoded data by adding a carrier signal and transmits the data using an antenna. Data decoding using PIC 16F877 The data transmitted by the transmitter is received on the receiver output pin, which is decoded and sent to the RD0 pin. The decoding procedure is as follows: If the voltage on RD0 goes logic high, the TMR0 starts counting using the TMR0 value the received data can be interpreted and decoded. If TMR0 value is equivalent to the delay of 7.0 ms or greater then it is recognized as the START bit and decoding starts. Similarly if the TMR0 value is equivalent to delay of 4.5ms or greater then the decoded output is logic 1 else it is logic 0. These valued are stored in the register OUTPUT. I NEED SOMEONE WHO CAN WRITE A SUCCESFUL CODE AT THE RECEIVER END OF THE PIC.I am presently trying to connect the first pic(encoded data) to the second pic(decoded data) directly with a wire to check the results and then would try doing it [login to view URL] first pic16f877 output is given from pin 33(RB0) to the second pic pin19(RD0)and I would want to veiw the output on port C(RC0 to RC7 pins). Incase anyone has a problem understanding my problem statement I can email them the whole project documentation. Thanks Neels ## Platform I am using a picstart plus programmer.
Project ID: 3675692

About the project

1 proposal
Remote project
Active 19 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
1 freelancer is bidding on average $17 USD for this job
User Avatar
See private message.
$17 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
United States
0.0
0
Member since Apr 21, 2005

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.