Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

regarding microcontroller

Status
Not open for further replies.

yviswanathbe

Full Member level 4
Joined
Jun 14, 2007
Messages
221
Helped
10
Reputation
20
Reaction score
6
Trophy points
1,298
Activity points
3,066
float division in atmega8

Hi friends,

i have two doubts in microcontroller...

1) I am sending data from PC to 89S8252 microcontroller using VB6.0
The data format is in Hex.i am sending 5 words one after another.
ex:mscomm1.output=word1(word1 contains value in hex formatg)
result1=mscomm1.input
mscomm1.output=word2(same as above)
result2=mscomm1.input
In what format PC send out the data to controller on serial bus.

I have loaded a routine in the controller that when ever it receives the word it will revert back to the PC, But i am not getting the same word using VB6.0.if i doing this in existing software(Docklight) i am getting what ever data i am sending.

Please tell me where i am doing wrong,do i need any conversion before sending and receiving?



2) this is regarding AVR ATMEGA8
While doing multiplication,division,modulas operation what are the datatypes and format specifiers i should assign to the my resultant strings.

i have used longint,unsigned long int,but couldn't success in the manipulation.

help me in this two regards.

Thanking You.
viswanath
 

yviswanathbe said:
2) this is regarding AVR ATMEGA8
While doing multiplication,division,modulas operation what are the datatypes and format specifiers i should assign to the my resultant strings.

i have used longint,unsigned long int,but couldn't success in the manipulation.

If you can show us what you are doing, what is expected and what is happening we might be able to help you better.

Ignoring the overflow condition for now, two integer multiplication will result in integer, result of division can be integer and float (it depends on inputs to the division as well), results of modulas will be integer and this operator works only on integers.
 

hi,
i am doing AH meter using AVR ATMEGA8 microcontroller.
so in AH meter my requirement is measuring of current(depending on the shunt value)
i will have to set the shunt value in the LCD (what ever the shunt connected to the circuit).analog input from power supply(0-5V) will be connected to ADC.ADC will convert this Analog and i have to read converted ADC value every second and display in LCD.

i am calculating the current from the following formulae

current=((converted ADC value*shuntvalue)/adc resolution)
adc resolution in my case is 1023(2 power 10)

i am getting currect values when i connect shunt values ranging from 0-100A.
I am not getting beyond that.i.e.., some junk values are displayed in the LCD.
So what data type i have to use and what format specifier i have to use.

Thanks,
viswanath.
 

yviswanathbe said:
current=((converted ADC value*shuntvalue)/adc resolution)

Could you please tell the datatypes for variables used in above line? If you can paste section of your code it will be much more easier to find the problem
 

i am working on the dot matrix moving display but plan to incooporate an 89c51 microcontroller for the realization of this project.
plesae what do i do and how do i get reliable source
of ninformation
 

Hi dipal,

I have solved my problem,
i declared char data type for one of the variable,this collaps whole problem.

Any way thanks and keep enjoying....

Thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top