View previous topic :: View next topic |
Author |
Message |
Suus
Joined: 11 May 2004 Posts: 8
|
Read RAM memory |
Posted: Tue May 11, 2004 2:36 am |
|
|
Hello,
How can I read some values from the RAM memory?
Susan |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Tue May 11, 2004 2:50 am |
|
|
What do you mean by 'RAM memory'? If you want to check the value of a certain address in RAM, you can do this:
#byte var=address
The the variable 'var' will be pointing to the address you want. Example:
#byte var=0x6D
#byte port_b=0x06 |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Tue May 11, 2004 7:59 am |
|
|
We need to know more specifically the type of RAM you are dealing with,
I´m talking about the way you access it, parallel or serial.
Humberto |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Tue May 11, 2004 11:46 am |
|
|
On-board PIC RAM is easy:
Code: |
unsigned char mydata;
mydata = 99;
if (mydata == 99) {
// do something wonderful here
}
|
If you are talking about external RAM, it will depend on how it is interfaced. I've done a few designs that used external byte-wide SRAM for data storage (upto 512kbyte). It requires creating some kind of address and data busses along with writing code to support the busses and well as some kind of data structure for acessing the external RAM.
I've never used external serially addressable RAM but I have used SPI and I2C EEPROM. The built in features found in many of the PIC chips make this very easy. There are good example programs from CCS too.
Or do you mean getting data from the PIC RAM out to some other device, say a PC through a serial port or USB port?
Humberto and Halpo are right, you need to be much more specific in your questions. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
Suus
Joined: 11 May 2004 Posts: 8
|
|
Posted: Wed May 12, 2004 12:36 am |
|
|
Thanx for your answers,
I was a little disarranged. I thought there must be a command like a command for reading eeprom.
But it is much more easy than I thougt. |
|
|
|