ADC single conversion ?

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys,

I tried to implement the datasheet :
Page 235 ATMEGA128A datasheet
================
23.4 Starting a Conversion
A single conversion is started by writing a logical one to the ADC Start Conversion bit, ADSC.
This bit stays high as long as the conversion is in progress and will be cleared by hardware
when the conversion is completed. If a different data channel is selected while a conversion is in
progress, the ADC will finish the current conversion before performing the channel change.
===============

But when I did that, the seven segment always changing very quickly, I want to make it one value and display it....

I have created with small segment and it's working ok, but with the big segment it's not working as I want to be...

The flow : take the value from ADC ==> display the result to seven segment.

Any ideas ?
Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd approach this as a two part solution. I'd make a menu on the serial port with two items: 1) get an a/d value and print it on the serial port and 2) send a string to the lcd. When both of these subroutines work, you can call them from main.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have made on UART, and the value is correct...
Have a look on the case I have (been uploading now) :

http://youtu.be/HVI6uKDNaFI

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

so you init the a/d, init the pins for the led, and enter main. There you read the a/d into a var, use this var in a temperature calculation. You then convert the temperature from an integer to a string, then call the subroutine that writes a string to the led one char at a time. This assumes that the leds have an 8 bit latch to hold the data for every digit. The other way is to update all the leds 70 times a second. A timer interrupt that tics every ms can call a function called updatenextdigit(). This keeps all the digits lit at the same time but only on the back of your eyeball.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You normally multiplex a 7-seg display via a Timer interrupt.

Your video looks as if you are not regularly multiplexing. e.g. not using interrupts.

You can do the multiplex by polling but this means you can never have a wait-loop.

David.