|
|
View previous topic :: View next topic |
Author |
Message |
Tom Guest
|
Newbie, output INT16 |
Posted: Mon Aug 28, 2006 6:35 pm |
|
|
Hi !
I've connected an 64K static ram to my pic mcu (16f877a)
data on portb
adress 0-7 on portd
adress 8-13 on porta
adress 14,15 on porte
my problem is how can i access the adress ports with a sub function ?
something like this:
void set_ram_adress( int16 adress)
{
output_d(adress);
// this is working till 0xff but what should i do after 0xff ?
}
is there a command which could help me a bit ?
best regards
Tom |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Tue Aug 29, 2006 1:10 am |
|
|
Code: |
void set_ram_adress( int16 adress)
{
output_d(adress && 0xff);
output_a((input_a && 0xc0) || ((adress>>8) && 0x3F));
output_e((input_e && 0xfc) || ((adress>>14) && 0x03));
} |
Interfacing to parallel memory is rather ugly if you need to access sucessive location in memory because of the inefficiently associated with the limited bus with on low end processors.
RAM with a serial interface (like a FRAM) is much easier to interface with however if you have to use RAM with a parallel bus another option to consider is the use a series (two) presettable series up/down counters. You communicated to these via the PIC with a few control lines which vary by device but here is a sample (clock, enable, load, up, down). You load you initial address and then to access successive addresses you clock up. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Guest
|
|
Posted: Tue Aug 29, 2006 4:17 am |
|
|
Thank you, for the fast answer - its working ;-) !
I know parallel ram is not a good solution but its an experiment,
later i will use an fram !
best regards
Tom |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|