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

sending int16 using RS232

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



Joined: 24 Jul 2007
Posts: 7
Location: Jordan

View user's profile Send private message Yahoo Messenger MSN Messenger

sending int16 using RS232
PostPosted: Mon Sep 24, 2007 11:43 pm     Reply with quote

Hello
I have written to the program eeprom sucessfully, and then i need to read those data and send them via the RS232 terminal. The program writes to program eeprom successfully, but it does not send via the rs232.
The code is:
Code:
#include<16f877.h>
#fuses NOWDT, HS
#use delay (clock = 20000000)
#use rs232(baud=9600, xmit=PIN_C6,rcv=PIN_C7)
void flash (void);
int16 address;
void main()
{
   for (address = 7168; address<7178; address++)
   {
      write_program_eeprom(address,address%16);
      flash();
   }
   delay_ms(100);
   for (address = 7168; address<7178; address++)
   {
      printf("address:%Lu data:%Lu \n\r",address,read_program_eeprom(address));
      delay_ms(1000);
   }
}
void flash (void)
{
   output_high(PIN_B6);
   delay_ms(1);
   output_low(PIN_B6);
   delay_ms(1);
}

what is the wrong with this program?
_________________
Eng. Haytham Shyouk
B.A. Electronics Engineering
Ken Johnson



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

PostPosted: Tue Sep 25, 2007 6:03 am     Reply with quote

At a glance, code looks ok.

Does this part write/read 8- or 16-bit value to/from eeprom?

Ken
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