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);
 
 
 
}

Replies

  • Harshad Italiya
    Harshad Italiya
    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
    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
    Thread moved to Electrical and Electronics Section.
  • suga_babe
    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 ? :/
  • Harshad Italiya
    Harshad Italiya
    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
    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
    Still i'm not clear with your query. You're sending numbers from hyperterminal and processing it in microcontroller?
  • suga_babe
    suga_babe
    no ..am writing a function in the C program, send it to the microcontroller and show the output in the hyperterminal

You are reading an archived discussion.

Related Posts

Any ideas on Load bearing capacity in interference fit with shearing loads.
Hello! For a designer, a good software is important to design. According to you, what's your desired software?
What is the concept of solar paint? and what is the cost per square meter in India? Is it available commercialy ?
Would the alarming mortality at the AMRI hospital have been less if there was some way to mitigate the suffocation? In a centrally airconditioned building, ventillation is a regulated activity...
Any one can help me in Design Explanation for a trolley in packing section on assembly line of HORN, in which two is kept in a single box of different...