View previous topic :: View next topic |
Author |
Message |
tanyamahen
Joined: 01 Jul 2004 Posts: 14
|
External memory |
Posted: Thu Jul 01, 2004 1:05 am |
|
|
[/b]
Hi
I m using 18F8520 and trying store lots of data datas in "Flash 28F640". Can I use in-buile 'read' or 'setup' or 'write_external_memory function (usind AD bus)?. Can anyone give me good explanation about these in-buils function. I am bit confuse about the "external interface"
Thanks
Tanya |
|
|
carlosma
Joined: 24 Mar 2004 Posts: 53 Location: Portugal
|
|
Posted: Thu Jul 01, 2004 4:39 pm |
|
|
Hello
Do you see the examples, like EX_EXTEE.C and another Flash EEPROM like the driver 2416.C
bye
Carlos |
|
|
tanyamahen
Joined: 01 Jul 2004 Posts: 14
|
external memory |
Posted: Thu Jul 01, 2004 6:47 pm |
|
|
Hi
I have just ordered the CCS C compiler. So mean time I am doing software design. I am bit confuse about the address and data lines. Do you have EX_EXTEE.C file. If you can please email it to me.
Thanks
Tanya |
|
|
carlosma
Joined: 24 Mar 2004 Posts: 53 Location: Portugal
|
|
Posted: Fri Jul 02, 2004 1:48 am |
|
|
Yes share you email.
I do not have experiencia with this 28F640, but I think that it can help
Carlos |
|
|
tanyamahen
Joined: 01 Jul 2004 Posts: 14
|
still confuse about the external flash ??? |
Posted: Fri Aug 13, 2004 9:25 am |
|
|
Hi
I am trying do read and write external flash using data bus... can someone give some idea to me... I just fish the hardware ... when it build i need have code for it...
First I did was setup_external_memory
then I disable all intrrupt...
write_programe_memory();
......
do I need to set anything else...
please help me...
thanks
Tanya |
|
|
garyzheng
Joined: 22 Jul 2004 Posts: 25
|
post your code, maybe we can give you some advice:) |
Posted: Mon Aug 16, 2004 9:31 am |
|
|
|
|
|
tanyamahen
Joined: 01 Jul 2004 Posts: 14
|
External memory interface pic18 |
Posted: Tue Aug 17, 2004 10:16 pm |
|
|
Hi
Thanks for replay..
Ok I think I need tell bit more about what I am really doing...
Ok I have selected EMC -Extended Microcontroller mode (datesheet page71). This mean I can run my code in internal memory and I have access to external memory as well... So I have map the exteranl memory to 0x0fffff - 0x1fffff. ( I am trying to use external memory interface).
Then I selected 16bit byte select mode (datasheet page 75). My hardware similar to figure 6-3 in the datasheet page 75.
The reason for external memory is to store big amount of datas.
So I Try to use build in function....
So my question is... Am I using the build in function correctly...
int writedata[128];
setup_external_memory (EXTMEM_BYTE_SELECT | EXTMEM_WAIT_0);
write_external_memory( 0x0fffff, &writedata, 2);
.............
Thanks for helping me here...
Regards
Tanya |
|
|
Guest
|
maybe you should think about this:) |
Posted: Wed Aug 18, 2004 9:33 am |
|
|
when i am writing the internal memory eeprom, i should disable the interrupt, maybe writing the external eeprom didn't need to do it, but you know, sometimes CCS compiler is wierd, you should look at the disaseemble list of your C program, you can not count on the compiler too much. |
|
|
tanyamahen
Joined: 01 Jul 2004 Posts: 14
|
Still no answer from any one? |
Posted: Fri Aug 20, 2004 7:43 pm |
|
|
Hi...
I am still waiting for answer.....
look like I better waite for my hardware to arrive.... can I test these external memory write with simulator...? did anyone did it... can please tell how to do simulater test......
thanks
Tanya |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sat Aug 21, 2004 4:27 pm |
|
|
I can't answer all your questions because I've never worked with the external memory on a PIC controller. First a remark: The support of external memory is a relative new feature for the PIC processor and not many people have used it already. Consider this being a huge design risk!!! You are likely to run into problems like compiler bugs and not many people here will be able to help you.
Code: | write_external_memory( 0x0fffff, &writedata, 2); | Change this to:
Code: | write_external_memory( 0x0fffff, writedata, 2); | A bug like this is to me an indication that you are new into the area of C programming.
The function write_external_memory() is another example of the poor CCS documentation for the new added commands. I'm not sure, but I guess this function was meant for writing to SRAM or compatible FLASH devices. Anyway I think you can't use it.......
You say you are using the byte select mode using the schematics from datasheet page 75, this setup requires an additional I/O pin for selecting the upper- or lower byte. The CCS commands have no way to specify the I/O pin to use for this, so therefor I assume byte select is not supported. Another thing is that writing data to the 28F640 requires you to check a status register in the chip for success, the function write_external_memory() is not doing this.
Where does this leave you?
You will have to write your own access functions... Using the datasheets for the FLASH device this shouldn't be too difficult.
Just curious: The 28F640 is an 8Mbyte device, the PIC can only address a total memory space of 2MByte. How are you accessing the upper 6Mb?
Have you thought about using MMC memory cards? They can be accessed through a standard SPI-bus, available on many good available and cheap PIC types. |
|
|
tanyamahen
Joined: 01 Jul 2004 Posts: 14
|
Still with this write/read memory..... |
Posted: Mon Sep 20, 2004 10:10 pm |
|
|
You are right... THis build in function is no use at all. I am starting to don in assmbly.. Bit a worry too.
About This.
**************
Just curious: The 28F640 is an 8Mbyte device, the PIC can only address a total memory space of 2MByte. How are you accessing the upper 6Mb?
*************
I am trying to Page setting..
The sad new is... Hardware is design by another Engineer.. So I have live with this design.. This is a first time me too.
If you can help... Please help me.. |
|
|
|