Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

512 byte arrays - C18?

Status
Not open for further replies.

futz

Active Member
BoostC won't do 512 byte arrays. It's limited to 256 bytes. For my 18F4620 SD Card project I want to do 512 byte blocks without a bunch of overhead to split the reads/writes.

Can I do it if I change compilers? Maybe C18? PICC? C30 (I could change chips)?
 
Nigel Goodwin said:
How much RAM does the 18F4620 have?, big buffers are always a problem on PIC's.
Almost 4K, but it's in 256 byte banks.

I could code up a little thing to split it, but if C18 will do it for me without that extra work... well, I've been meaning to give it a test anyway. If it won't do it I may as well stay with BoostC.
 
Futz, If I remember correctly you have just ventured into the 18F family? I also thought you started to use 16-bit micros. Any reason for not using a 16-bit micro? With the 16-bit chips Banks are eliminated and all the problems associated with them. 24FJ64GA002 is an equivalent chip minus EEPROM.
 
donniedj said:
Futz, If I remember correctly you have just ventured into the 18F family? I also thought you started to use 16-bit micros.
Umm... Not really. I ventured into 18F's many years ago when they were something new. I have tons of different PICs. My reason for using the 4620? I threw a dart. :D I had it. Hadn't used it yet. "Ok, that's the one I'll use." :p

I'm kind of schizo in my "studies". This is just a hobby for me, not a job. Nor am I in school. It's just for fun. I jump around to whatever interests me at the moment. I can be very focused on one thing for a while and then another shiny thing distracts me and I'm off on something else. :p

Any reason for not using a 16-bit micro? With the 16-bit chips Banks are eliminated and all the problems associated with them. 24FJ64GA002 is an equivalent chip minus EEPROM.
No good reason at all. I have a 24F that I should have used, but where's the challenge there? :p It's already 3.3V.
 
Last edited:
Futz,

I seem to recall this subject coming up on Forum.Microchip several times but I haven't had the need with C18 yet so I don't remember the solution. Might be worth a search at Forum.Microchip for you though.

Mike
 
I think you are limited to 256 byte arrays in C18. There may be some magic that can be performed with the linker script but, if there is, I don't know it.

Mike.
 
Mike said:
I seem to recall this subject coming up on Forum.Microchip several times but I haven't had the need with C18 yet so I don't remember the solution. Might be worth a search at Forum.Microchip for you though.
Ya, I grabbed C18 and did a bit of reading of the manual. But then I had to do some real work and haven't had time to pursue it. Tonight for sure...
 
Pommie said:
I think you are limited to 256 byte arrays in C18. There may be some magic that can be performed with the linker script but, if there is, I don't know it.
You could be right. C30 does do 512's though, cuz the book I'm stealing code from does 512 byte arrays and it's a PIC 24F and C30 book.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top