2003-11-13 06:50 PM
2003-10-30 03:15 AM
Hi,
I'm trying to generate assemblercode for st7lite29 that reads serial data and save it to an array. The receivng-data part works fine, but i have troubles writing it to the array begin: inc _count ; Receive serial data (works fine) ; Save data to array at location '_count' btjt $0000,#7,loop ;other data to come? --> goto begin If someone has an idea how i can do this, i'd be very happy to know. Greets, Johan.2003-10-30 08:08 AM
use index addressing with a buffer eg.
clr X loop call receive data ; receive data in A ld (buffer,X), A inc X ; ready for next byte cp X, #10 ; received 10 bytes yet ? jrne loop ; get next byte Hope this helps sjo2003-10-30 09:59 PM
Thanks Sjo,
You have helped me very much. I have inserted your code and it works fine. greets!2003-11-13 12:04 AM
Hi again,
When i write more than 13 datavalues into this array, the data is corrupted. Maybe it is because the variable buffer should be declared and the data is stored into registers that are used for other variables. Anyone an idea how to solve this. Greets.2003-11-13 12:14 AM
Make sure you declare a large enough buffer eg.
.buffer dsb 20 ; 20 byte array Regards sjo2003-11-13 01:27 AM
Hi,
Thanks for your fast repy. I now have declared an array with 50 places. And this works. But I need more spaces, and my memory space does not to be large enough. Maybe I can rearrange the memory space. I hope to have an array with 512 data places. I'll try to change de lkf file to make this possible... greets.2003-11-13 03:59 AM
Remember the flite29 only has 384bytes of ram (128 is stack).
It sounds like you need to change the way you are doing things or get a bigger micro with more ram. Regards sjo2003-11-13 06:50 PM
I'm looking for a way to decrease the amount of data that has to be stored. This can't be difficult.
Thanks!