External flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

External flash

1,417 Views
PW_CTL
Contributor III

Hi All, 

 

I need to read big amounts of data with a S08SH MCU, so I was considering to add a external flash to my design.

 

Is there any AN about the usage of an external flash?

 

- Type of flash (SPI NOR, NAND...) and connection. I need to manage about 4-8MB, so a external SPI NOR flash woul be perfect.

- Programming. Is it possible to program an external flash from Codewarrior?

 

 Thanks and best regards.

Labels (1)
0 Kudos
9 Replies

928 Views
bill_a
Contributor I

I think both previous responders missed that you wanted to use SPI, i.e. serial, flash.

 

The answer is no, it's not possible to access serial flash from Codewarrior.

 

But it is very possible and fairly easy to download the data from say the RS232 port and have the micro itself store it in the flash.  If you're program-space limitied, after you load the flash, you can reprogram the micro for your real application (assuming of course the data in the flash doesn't need to change on the fly).

 

You'd need an app on the PC to download the data in smallish blocks that you can store in MCU RAM as you program the flash.

 

Regards,

Bill

0 Kudos

928 Views
PW_CTL
Contributor III

Thank you very much for your replies. 

 

Then, do you suggest me to use an external programmer to program the flash, and then read/write it with the MCU, and  don´t include the content of the flash in the .s19, right? 

 

Bye!

0 Kudos

928 Views
bill_a
Contributor I

Your original question concerned programming an external SPI flash with Codewarrior, which you can't do. My suggestion was just one of many options you have for getting the data in the SPI flash in the first place.

 

If the data will fit in internal flash (along with your application), then yes, you can include it in the s19 file, but then you wouldn't necessarily need the SPI flash. Bear in mind that if your application needs to change the data on the fly, it's much harder if its in internal flash.

Bill

0 Kudos

928 Views
PW_CTL
Contributor III

Ok, then I will do an external SPI programmer via RS232 with another SH8. It should not be complicated to do. Everybody thinks this is the easiest way?

 

Thanks for your replies.

0 Kudos

928 Views
Mickey
Contributor III

provide a convenient method:

    must first have a custom programmer for hcs08.

1. control the mcu download to eeprom through spi interface.(data stream through bkgd to ram or flash)

2. eraser chip than program the hcs08 firmware.

3. finish.:smileyhappy:

0 Kudos

927 Views
PW_CTL
Contributor III

I recover this post more than one year later...

 

I've finally tried to do the external programmer. I pass the data via serial port to the MCU (successfully, page by page) and I tried to program the SPI NOR flash also page by page.

 

My flash is a M25P16, but I cannot get communication with it. I tried to erase the flash, and read individual register, but I always read a 0. There are no errors but the communication is obviously not working.

 

 I tried a lot of things, the lines with the oscilloscope seems clean:

 

- Modify the speed of the communication 

- With CS and without CS, keeping the CS pin low.

- A different flash

- Setting the communication active with rising and falling edge

- MSB, LSB...

 

I don't have more ideas. The result is always the same, I always read a 0 because the communication is not working.

 

Any idea?

 

0 Kudos

927 Views
PW_CTL
Contributor III

I reply myself.

 

I was forgetting to send a dummy byte. This generates a clock and allows the slave to send the requested bytes.

 

 

0 Kudos

928 Views
J2MEJediMaster
Specialist I

You should be able to program external flash provided that the processor bus has been configured to access them correctly. The app note AN3859 discusses how to add new flash devices to the flash programmer built into CodeWarrior for MCUs v10. The documentation is ColdFire-specific, but the basic principles should apply for interfacing flash to HCS08/RS08 MCUs.

 

---Tom

0 Kudos

928 Views
Mickey
Contributor III

Hi Tom

    i don't know if there is no physical address. data line, as this will expand it? or can only store data, and can not store programs. flash may have to use 3rd party tools for pre-download?

0 Kudos