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.

Help me with saving data in PIC

Status
Not open for further replies.

engineer123

Junior Member level 3
Joined
Apr 1, 2008
Messages
25
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,500
Hi all,
If I have send for example data from pc through RS232 to pic18f4550 is there away to save this data in the PIC if yes , how can I read it again , and if yes how can I save to different addresses into the PIC ‘

For example :

I have send to PIC18F4550 h’50’ I need to save this value into specific address in the memory
And send h’51’ to save this data in another address in the memory???

Thanks
 

PIC saving data help

design your potrotocol as your requerment.....
like first you send address and the data
 

Re: PIC saving data help

can you please explain more , cuz i know that we send address and then we sending data to save it at the required address , but how ? using the usart lets say i'm going to use the the pic memory , and i have the RCREG , I send the address how do i select the address and how can i send the data after then to the required address ?????

Added after 3 hours 9 minutes:

what i meant :

how can I :
First : point the RCREG to the required address
Second : write the value of RCREG to the required address register

?? is it possible to do something like that
 

PIC saving data help

Sent adres high from PC to RCReg
use movwf RCReg to a temperary ram location
Sent adres LOW from PC to RCReg
use movwf RCReg to a temperary ram location
Sent data from PC to RCReg
use movwf RCReg to a temperary ram location
Then mov data t o the required ram or EEProm location.

Read the Datasheet. Read books on programming.
 

Re: PIC saving data help

Oki, maybe I didn’t ask my question correct or maybe I didn’t understand the posted solution
Let’s say that I configured 3 temporary registers in the RAM:
(just example, please don’t care about the address if they are correct for 18f family)
RAM1 equ 0x0C
RAM2 equ 0x0D
RAM3 equ 0x0E
Now : through RCREG to point to RAM1 and write the value there , to RAM2 and write another value and RAM3 and write another value ?
 

PIC saving data help

Study Paragraph 5.3 (page 63) of the manual.
Learn how to use BSR register

Remember the adres high, as mentioned before, you can just use the memory bank wherein the ram addres is. then store this to the BSR register.
then do the movwf.
 

Re: PIC saving data help

can you please if its possible post short example how you do that , cuz i followed the manual i didnt get that ?): ): ): ?? how to direct Rcreg to the adres ;

i dont know i'm sorry i'm trying but i didnt get it ,
 

Re: PIC saving data help

Hi ;

did you mean ; first to check if the RCREG ADDEN bit , and then to move the value of RCREG (which adres) to FSR and then to check which register has the value , and then to send the data

thats what you meant
 

PIC saving data help

;FIRST SAMPLE LONG METHODE
;receive adres and data
movf RCReg,W
movwf AdrHReg
movf RCReg,W
movwf AdrLReg
movf RCReg,W
movwf DataReg
;end of receive adres and data

;process data to wanted ram location

movf AdrHReg,W
movwf FSR0H
movf AdrLReg,W
movwf FSR0L
movf DataHReg,W
movwf indf0
;end of process data to wanted ram location
;END FIRST SAMPLE

;SECOND SAMPLE SHORT METHODE
movf RCREg,W
movwf FSR0H
movf RCReg,W
movwf FSR0L
movf RCReg,W
movwf indf0
;END SECOND SAMPLE SHORT METHODE
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top