CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

RS232 receive

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Rupert Kruger
Guest







RS232 receive
PostPosted: Sun Nov 18, 2001 11:06 pm     Reply with quote

Hi,

I am building a project that requires Serial communications. The incoming data is read into a buffer for later processing, but there is too little RAM left to make a big enough buffer to receive all the data. I was thinking of maybe, everytime the buffer gets full, I can empty the buffer to EEPROM. Is this possible? How would I do it?

Thanks
___________________________
This message was ported from CCS's old forum
Original Post ID: 1213
Dave Y.
Guest







Re: RS232 receive
PostPosted: Mon Nov 19, 2001 12:02 am     Reply with quote

I would to get a few questions answered:
1. What is the recv speed?
2. What kind of chip?
3. If it has a hardware UART are you using it?
4. Are you willing to use something like RAMTRON FRAM?
5. What is the amount of the data?
6. how much memory do you have?

When these questions are answered we might be able to give you a concrete answer....
Dave

:=Hi,
:=
:=I am building a project that requires Serial communications. The incoming data is read into a buffer for later processing, but there is too little RAM left to make a big enough buffer to receive all the data. I was thinking of maybe, everytime the buffer gets full, I can empty the buffer to EEPROM. Is this possible? How would I do it?
:=
:=Thanks
___________________________
This message was ported from CCS's old forum
Original Post ID: 1216
Rupert Kruger
Guest







Re: RS232 receive
PostPosted: Mon Nov 19, 2001 12:37 am     Reply with quote

:=I would to get a few questions answered:
:=1. What is the recv speed?
9600 baud
:=2. What kind of chip?
PIC16F877 @ 4MHz
:=3. If it has a hardware UART are you using it?
Yes
:=4. Are you willing to use something like RAMTRON FRAM?
If at all possible, no. But I am open for suggestions.
What is this RAMTRON FRAM?
:=5. What is the amount of the data?
About 200 bytes. After reception of the data it gets
processed and discarded.
:=6. how much memory do you have?
Well, according to the compiler I have in use about 70\% RAM
and 50\% ROM (but the program is not finished yet...).
EEPROM, I have 256 bytes.
:=
:=When these questions are answered we might be able to give you a concrete answer....
:= Dave
:=
:=:=Hi,
:=:=
:=:=I am building a project that requires Serial communications. The incoming data is read into a buffer for later processing, but there is too little RAM left to make a big enough buffer to receive all the data. I was thinking of maybe, everytime the buffer gets full, I can empty the buffer to EEPROM. Is this possible? How would I do it?
:=:=
:=:=Thanks
___________________________
This message was ported from CCS's old forum
Original Post ID: 1217
Felix Althaus



Joined: 09 Sep 2003
Posts: 67
Location: Winterthur, Switzerland

View user's profile Send private message

Re: RS232 receive
PostPosted: Mon Nov 19, 2001 4:56 am     Reply with quote

:= What is this RAMTRON FRAM?

FRAM is a new generation of memory meaning "ferroelectric RAM". It' s a nonvolatile memory like an EEPROM, but it has write cycles of approximately 1us (much faster than EEPROM with 1ms or more).

for more details see the link below.

mfg
Felix
___________________________
This message was ported from CCS's old forum
Original Post ID: 1224
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: RS232 receive
PostPosted: Mon Nov 19, 2001 1:06 pm     Reply with quote

The byte writing rate of EEPROM is too slow for what you suggest but the page writing rate for EEPROM may be fast enough because you write 16 bytes almost as fast as a single byte. Also remember EEPROM has a limited number of write cycles so this would not work for a continous data stream.
___________________________
This message was ported from CCS's old forum
Original Post ID: 1236
Dave Y.
Guest







Re: RS232 receive
PostPosted: Tue Nov 20, 2001 5:03 pm     Reply with quote

Wellll.... OK, that gives us something to go on.

1. First off I assume the data is not continous streams one immediately following another. If it is, the items I list below are pretty much imperative. If not, the ring queue approach I mention below should work for you with the breaks in the data to allowing you to catch up.

2. Running at 9600 baud receive, 4MHZ is pretty slow. With the F877 I would recommend bumping your processor speed up as high as you can (20MHZ??)to give you some breathing room, however, using the hardware UART helps a bunch.

3. If you are using interrupt controlled receive rather than polled you have some time to process data from a ring queue between characters. The CCS example EX_SISR.C has a good example of a basic ring queue implemetation.

4. If you are willing to use FRAM you can move data right out to FRAM between each incoming char with no sweat. Using EEPROM is trickier timing wise but can be done using the ring queue I suggested above.

5. Avoid using Delay_xx() statements anywhere otherwise you likely can't do any of the above.

6. To avoid delay_xx statements make use of your timers and set flags for processing in the main loop. I have one timer dedicated to setting flags for process management in just about all my programs.

If you do these things it should work out.

BTW, I use the RAMTRON FM24C16 and FM24C64 FRAM a lot and they work great for me, not to mention they would give you LOADS of storage space for a few dollars. They're available from Future Active Electronics on the web.

Good Luck!
Dave


:=:=I would to get a few questions answered:
:=:=1. What is the recv speed?
:= 9600 baud
:=:=2. What kind of chip?
:= PIC16F877 @ 4MHz
:=:=3. If it has a hardware UART are you using it?
:= Yes
:=:=4. Are you willing to use something like RAMTRON FRAM?
:= If at all possible, no. But I am open for suggestions.
:= What is this RAMTRON FRAM?
:=:=5. What is the amount of the data?
:= About 200 bytes. After reception of the data it gets
:= processed and discarded.
:=:=6. how much memory do you have?
:= Well, according to the compiler I have in use about 70\% RAM
:= and 50\% ROM (but the program is not finished yet...).
:= EEPROM, I have 256 bytes.
:=:=
:=:=When these questions are answered we might be able to give you a concrete answer....
:=:= Dave
:=:=
:=:=:=Hi,
:=:=:=
:=:=:=I am building a project that requires Serial communications. The incoming data is read into a buffer for later processing, but there is too little RAM left to make a big enough buffer to receive all the data. I was thinking of maybe, everytime the buffer gets full, I can empty the buffer to EEPROM. Is this possible? How would I do it?
:=:=:=
:=:=:=Thanks
___________________________
This message was ported from CCS's old forum
Original Post ID: 1261
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group