Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 21st September 2007, 03:43 AM   (permalink)
Default More PIC space

is it possiable to some how wook something like an SD card to a PIC and/or AVR microcontroller so that it has a whole bunch of memory?

Last edited by Guyfrom7up; 21st September 2007 at 03:47 AM.
Guyfrom7up is offline  
Old 21st September 2007, 04:24 AM   (permalink)
Default

most small AVR and PICs do not have externally visible data and address lines, so at most you can use external memory to save data only - you can't store code.

Not sure what you want to store in the external memory... but usually you can save quite a bit of data though.
boxer4 is offline  
Old 21st September 2007, 09:12 AM   (permalink)
Default

Like boxer4 says, you can add an SD card to store data, but not to run programs from - but PIC's usually have more than enough program memory anyway.

But you need to be more explicit with your question.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 21st September 2007, 08:52 PM   (permalink)
Default

Maybe the PiC might have enough internal memory, I'm going to try and make a device like an arduino board, but you can store multiple programs on it and select a program on a screen. After that you can plug stuff like LED's into it.
Guyfrom7up is offline  
Old 21st September 2007, 09:11 PM   (permalink)
Default

Choose an 18F PIC then, these have a lot of memory space, should be no problem.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 21st September 2007, 09:43 PM   (permalink)
Default

"A whole bunch of memory" is colorful but....

How many K Bytes of memory do you need?
3v0 is online now  
Old 21st September 2007, 10:15 PM   (permalink)
Default

Quote:
Originally Posted by 3v0
"A whole bunch of memory" is colorful but....

How many K Bytes of memory do you need?
I think it's pretty obvious he doesn't know, nor is he likely to until he's written the application.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 21st September 2007, 10:17 PM   (permalink)
Default

What about external EEPROM's?

Lol my signature is bigger than the entire text of this post

Draws your attention away
Krumlink is offline  
Old 22nd September 2007, 12:37 AM   (permalink)
Default

This is a major project.

The Arduino uses a ATmega168 which has 16K bytes of flash. You should be able to use a 18F PIC and no external memory. The PIC18F chips come with up to 64K words flash (128K bytes) onboard.

I am not sure what level you are at so I will try to keep it simple. Please forgive me if any of what follows is too elementary.

The Arduino board system uses 2 parts. A JAVA IDE that runs on a PC/MAC and a set of libraries that run on the AVR.

When one system generates code for another it is know as cross platform development. In this case the PC/MAC is development platform and the AVR/PIC is the target platform. The IDE on the PC/MAC generates code that runs on the Arduino AVR/PIC. The system is cross platform.

The code generated for the Arduino may or may not be specific to the AVR's instruction set. The library that runs on the AVR certainly is.

If you choose to setup an Arduino using a PIC you must be prepared to port (modify for use on another system) the AVR code library to the PIC. If the IDE generates AVR specific code you must retarget (generate PIC instead of AVR) it to generate PIC code.

It is possible that the code used to generate the AVR code within the IDE is isolated or even table driven. If so that will make retargeting it much less difficult but not easy.

In short you need to be fluent on both the AVR and the PIC of choice to make this work.

EDIT: You may also run into speed/timing problems during the port. After you do the port you still need to modify the code to store multiple programs and make use of the extra resources on PIC.

If you want to do this I suggest you contact the people who did the original code and get to know them and their code. They may even make you part of the project.

If you are thinking of starting from scratch, it would be a lot more work.

Last edited by 3v0; 22nd September 2007 at 12:44 AM.
3v0 is online now  
Old 22nd September 2007, 12:57 AM   (permalink)
Default

Quote:
Originally Posted by Guyfrom7up
is it possiable to some how wook something like an SD card to a PIC and/or AVR microcontroller so that it has a whole bunch of memory?
I aggree with most, you most likely will have an abundance of Program Memory using any 8K or 16k mcu.

Now if you would like to utilize External Memory Bus for whatever reason, looking into the PIC18F87J50 series of micros. Supports up to 2Mbytes. These are 80 pin devices. The use of 80-pins and greater than 16K of program is so outside the scope of this forum
donniedj is offline  
Old 22nd September 2007, 01:16 AM   (permalink)
Default

Quote:
Originally Posted by donniedj
I aggree with most, you most likely will have an abundance of Program Memory using any 8K or 16k mcu.
I've found a way of using lots of program memory - do floating point calculations using the C library functions ... I've been trying to code up the Latitude/Longitude to OSGB Easting/Northing conversion on an PIC18F4550 - I was planning to use the USB functionality to communicate with a PC and use the USART to receive NMEA sentences from a GPS receiver.

I have a working version of the conversion algorithm, and that (together with the library code that it has pulled in) has taken up nearly 75% of the available program memory. I'm beginning to think that I may have to go to a design with 2 PICs, one doing USB to a PC and various other functions and the other doing the co-ordinate conversion and then communicate between them with I2C or SPI or something similar.
David James is offline  
Old 22nd September 2007, 02:55 AM   (permalink)
Default

So to have I:

ORG 0X3FFF
MAIN:
donniedj is offline  
Old 22nd September 2007, 05:44 AM   (permalink)
Default

Well the thing to reiterate is that with the exception of the few External Memory Bus parts, external memory cannot hold program data. Well it can hold slow "interpreted code", where the program memory contains an interpreter and the external data is pseudoinstructions like BASIC Stamp data. This is very slow.

Technically program data can be read from any source and burned into onboard program memory to be run like any other program except that it's slow, it's a sensitive process, and the part can only sustain rewrites a limited number of times before wearing out.

So, basically, the answer is "no", you can't do this with a PIC unless you've got that External Memory Bus. In truth people rarely need to do this anyways.
__________________
I thought what I'd do was I'd pretend I was one of those deaf-mutes.
Oznog is offline  
Old 22nd September 2007, 05:48 AM   (permalink)
Default

Quote:
Originally Posted by David James
I've found a way of using lots of program memory - do floating point calculations using the C library functions ... I've been trying to code up the Latitude/Longitude to OSGB Easting/Northing conversion on an PIC18F4550 - I was planning to use the USB functionality to communicate with a PC and use the USART to receive NMEA sentences from a GPS receiver.

I have a working version of the conversion algorithm, and that (together with the library code that it has pulled in) has taken up nearly 75% of the available program memory. I'm beginning to think that I may have to go to a design with 2 PICs, one doing USB to a PC and various other functions and the other doing the co-ordinate conversion and then communicate between them with I2C or SPI or something similar.
Wow 75%? Something is wrong! I've read NMEA sentences from a 4800 baud serial GPS, and it doesn't require anything like that to interpret lat-longitude and calculate a distance between 2 pts and all that.
You don't need- or even want- floating point ops for this. They're incredibly slow and floating point accuracy is sometimes difficult to predict.
__________________
I thought what I'd do was I'd pretend I was one of those deaf-mutes.
Oznog is offline  
Old 22nd September 2007, 05:15 PM   (permalink)
Default

Quote:
Originally Posted by Oznog
Wow 75%?
The map file reports "23727 out of 33048 program addresses used, program memory utilization is 71%"

Quote:
Originally Posted by Oznog
Something is wrong! I've read NMEA sentences from a 4800 baud serial GPS, and it doesn't require anything like that to interpret lat-longitude and calculate a distance between 2 pts and all that.
That's not what to want to do. I want to do the conversion from latitude/longitude to OSGB (Ordnance Survey Great Britain) eastings and northings. The formulae are in the pdf that I gave a link to. They are complicated. It may be possible to simplify them, but I've not had time to consider that.

Quote:
Originally Posted by Oznog
You don't need- or even want- floating point ops for this. They're incredibly slow and floating point accuracy is sometimes difficult to predict.
I can't see how to cast the trigonometric formulae into something that doesn't use floating point - I'm not saying it can't be done, just that I've not yet figured out how to.

Last edited by David James; 22nd September 2007 at 05:18 PM.
David James is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Can i make an Intelligent Switch by using PIC 16F84A rukshankb Micro Controllers 3 22nd September 2007 04:58 PM
PIC Timing baberjaved Micro Controllers 10 21st September 2007 02:06 AM
Four PIC with One LCD.. meera83 Micro Controllers 13 20th September 2007 07:40 AM
Parking Space Detection dmiga Electronic Projects Design/Ideas/Reviews 4 16th June 2004 01:05 AM
Protect a memory space for pic877? EYF Micro Controllers 1 12th November 2003 11:07 AM



All times are GMT. The time now is 09:51 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker