Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 20:13 09 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PIC RAM question

Author Message
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 12:35pm 24 May 2013
Copy link to clipboard 
Print this post

Hello

Hey with a PIC chip, I am used to assigning a single character to a register.

For instance

$GPRMC,123456,

Where 123456 are 6 different memory registers.

Is it possible in a PIC chip to assign a memory location for the whole string ?

Like

$GPRMC,123456,A,LAT,NS,LON,EW,SPEED,VAR,CHECKSUM*

I want to store and be able to spit out the entire string from

$GPRMC ......................................*

GPRMC to the star - these are my markers.

Maybe some wort of increment register ? write to location.

Is that RAM or EEPROM ?

- Andrew - Edited by vk4tec 2013-05-25
Andrew Rich VK4TEC
www.tech-software.net
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 01:05pm 24 May 2013
Copy link to clipboard 
Print this post

  Quote  Hey with a PIC chip, I am used to assigning a single character to a register.


Your question is a little vague (to me at least).

Firstly, what PIC chip are you using and what lnaguage are you programming in?

If you have enough registers to store the data you want then it is possible as long as your assembler/compiler? lets you do it.

More information needed.
David M.
 
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 01:28pm 24 May 2013
Copy link to clipboard 
Print this post

More intel

What is the best way to assign a RAM space in a 16F628A and access it other than assigning one memory spot per character

Can you say start here and every time increment a ram address counter ?

I want to read a GPS strong and keep over writing a memory location with the data

Andrew
Andrew Rich VK4TEC
www.tech-software.net
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 04:02pm 24 May 2013
Copy link to clipboard 
Print this post

I would say the question is still not clear. Normally when you are working with strings every character occupies one memory location anyway.
For pulling data from the NMEA0183 strings you need a parser, which is software and does not have anything to do with the type of the micro.
http://rittle.org

--------------
 
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 04:35pm 24 May 2013
Copy link to clipboard 
Print this post

When working in assembly lanfuage with a PIC chip

Is it possible to speficfy a start address of RAM and then incremnet that RAM address counter and write charcater after character

And then read back the same way

I will try it and report back

- Andrew -
Andrew Rich VK4TEC
www.tech-software.net
 
kiiid

Guru

Joined: 11/05/2013
Location: United Kingdom
Posts: 671
Posted: 04:55pm 24 May 2013
Copy link to clipboard 
Print this post

Auto-incremental addressing... No, that can't be done with PIC16. You will have to increase the index manually after storing each byte.
http://rittle.org

--------------
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 06:19pm 24 May 2013
Copy link to clipboard 
Print this post

Load your FSR register with the location of the the first byte of your string storage and then write/read to the INDF register to put/get data to/from your string. You will need to increment the FSR register (INCF FSR,F) to point to the next location.

The FSR is an index register. The INDF is a pseudo register linked to the FSR.

Don't forget to keep the location of your string storage somewhere so you can reload the FSR to the beginning as needed.

You will need some sort of parse routine to read the indiviual bytes and format the data accordingly.

Edited by MOBI 2013-05-26
David M.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3674
Posted: 09:14pm 24 May 2013
Copy link to clipboard 
Print this post

Ah, the memories.

This is why so many people use C. All manner of code moves between all manner of CPUs, really rather easily (often no changes).

Generally runs not much slower than ASM. Takes a bit more space.

John
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 09:48pm 24 May 2013
Copy link to clipboard 
Print this post

  Quote  Ah, the memories.

This is why so many people use C.


Somehow, I prefer the satisfaction of ASM but as I've said elsewhere, I use both because both have their uses.

On 628A subject, I am quite happy to help write an ASM routine to do all the GPS things that Andrew wants to do. It is not that hard - "just" need to know what BYTE size each of the data elements is.

I still don't know what programming language Andrew has and what ICSP facilities? It would sure help.
David M.
 
vk4tec

Senior Member

Joined: 24/03/2012
Location: Australia
Posts: 239
Posted: 09:52pm 24 May 2013
Copy link to clipboard 
Print this post

I have the Assembly for the NMEA parser and LCD display

I was just trying to improve the memory usage.

ICSP is PicKit3 microchip

- Andrew -
Andrew Rich VK4TEC
www.tech-software.net
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 12:24am 25 May 2013
Copy link to clipboard 
Print this post

  Quote  I was just trying to improve the memory usage.


I don't think you will achieve that as your data format will be the same however you use it, so the memory usage will be the same.

Are you already able to load the GPS data into the 16F628A, or is that what you are working towards?

I think I need a bit more about your setup such as cct diag, photo etc as I'm still not really sure what you are up to.


David M.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024