View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12933 Members
Join this group to post and comment.
suga_babe
suga_babe • Dec 11, 2011

Making A Hyperterminal Calculator By Interfacing With Hcs12e128

i have a project to design a calculator with the hyperterminal by writing a source code and compile it with the CodeWarrior. i am using the motorolla S12E128.
i have wrote a code for the interfacing between the two, but i am stuck when coming to the calculator's part. here is the code i wrote so far - which was tested-
i need help in writing the rest... thanks



#include  /* common defines and macros */
 
#include  /* derivative information */
 
#pragma LINK_INFO DERIVATIVE "SampleS12"
 
void periphlnit(void){
 
SCI1BDH=0x00;
 
SCI1BDL=0x34; //sets SCI baud rate to 9600,N,8,1
 
SCI1CR2=0x08;
 
}
 
void Write(const char*text){
 
while(*text !='\0'){
 
while(!(SCI1SR1 & 0x80))
 
;
 
SCI1DRL=*text++;
 
}
 
}
 
void delay(int);
 
void delay(int n){
 
while(n>0)n--;
 
}
 
void main(void){
 
periphlnit();
 
EnableInterrupts;
 
for(;{
 
Write ("Tested on Micro lab\n\r");
 
delay(32000);
 
 
 
}
Harshad Italiya
Harshad Italiya • Dec 12, 2011
So basically you have problem while you sending some texts to pc right? Can you please let me know your SCI settings?
Harshad Italiya
Harshad Italiya • Dec 15, 2011
suga_babe
i have a project to design a calculator with the hyperterminal by writing a source code and compile it with the CodeWarrior. i am using the motorolla S12E128.
i have wrote a code for the interfacing between the two, but i am stuck when coming to the calculator's part. here is the code i wrote so far - which was tested-
i need help in writing the rest... thanks



#include  /* common defines and macros */
 
#include  /* derivative information */
 
#pragma LINK_INFO DERIVATIVE "SampleS12"
 
void periphlnit(void){
 
SCI1BDH=0x00;
 
SCI1BDL=0x34; //sets SCI baud rate to 9600,N,8,1
 
SCI1CR2=0x08;
 
}
 
void Write(const char*text){
 
while(*text !='\0'){
 
while(!(SCI1SR1 & 0x80))
 
;
 
SCI1DRL=*text++;
 
}
 
}
 
void delay(int);
 
void delay(int n){
 
while(n>0)n--;
 
}
 
void main(void){
 
periphlnit();
 
EnableInterrupts;
 
for(;{
 
Write ("Tested on Micro lab\n\r");
 
delay(32000);
 
 
 
}
I think there may be problem with initialization remaining code looks OK.
Harshad Italiya
Harshad Italiya • Dec 15, 2011
Thread moved to Electrical and Electronics Section.
suga_babe
suga_babe • Dec 16, 2011
my main issue is how to desogn the calculator itself.. how to assign the values and commands in the source code so the calculations can be performed.. got me ? :/
Harshad Italiya
Harshad Italiya • Dec 16, 2011
suga_babe
my main issue is how to desogn the calculator itself.. how to assign the values and commands in the source code so the calculations can be performed.. got me ? :/
Are you going to design GUI at PC side? microcontroller or PC who performs the calculation?
suga_babe
suga_babe • Dec 23, 2011
i thought about using the switch statment for start.. to compare between two numbers and give the smallest or the largest
Harshad Italiya
Harshad Italiya • Dec 23, 2011
Still i'm not clear with your query. You're sending numbers from hyperterminal and processing it in microcontroller?
suga_babe
suga_babe • Dec 25, 2011
no ..am writing a function in the C program, send it to the microcontroller and show the output in the hyperterminal

Share this content on your social channels -