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 CCS Technical Support

Just one change to the bootloader example....
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
RckRllRfg



Joined: 20 Jul 2011
Posts: 60

View user's profile Send private message

The use of the delay_ms command may be the culprit
PostPosted: Fri Aug 26, 2011 6:03 pm     Reply with quote

Update:

In looking at the .lst file, I found a number of calls being made to address 414 when I used the delay_ms command in the code.

I am using RS-485 with a half duplex. I have to control the transceiver. I have found that I have to put a 10ms delay after using the putchar commmand (or longer if I am using the fprintf command) to ensure that the message is completely sent prior to switching the transceiver to the receive mode.

So, I think I will create a function with memory space allocated to it that simply contains the delay. I'll update everyone as I make progress. Any recommends are truly welcomed.

Regards -

RckRllRfg
RckRllRfg



Joined: 20 Jul 2011
Posts: 60

View user's profile Send private message

Got it working!
PostPosted: Fri Aug 26, 2011 7:26 pm     Reply with quote

Though its not optimal, but I'll take it....!

I added a #Separate command to a function I created called TXdelay. It is nothing more than:

void TXdelay(void)
{
delay_ms(10);
}

Granted, this could be very much embellished; however, I need to keep things moving.

Then I found that when I compiled it, it was sending this command between addressed 10 thru 20. The rest was then sent to the 414 address space.

I then tried to force it out of that space low memory space by changing the #ORG 0x20, 0x7A to #ORG 0x10, 0x7A

BUT, that only encourage the compiler to put the whole thing back into the address 414.

So, since I had more than enough memory for the main, I change it to:

#ORG 0x30, 0x7A

This was enough to keep it out of the 400h area of the code.

Are there better ways of doing this? I hope so and I am up for any ideas. But, at this point, I am able to get the bootload.c loaded, so I am a happy camper.


Very Happy Very Happy
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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