|
|
|
|
|
ÀÌ ¸Å´º¾óÀº JKÀüÀÚ(JK Electronics) ¿¡ ÀÇÇؼ ¹ø¿ª, ¼öÁ¤, ÀÛ¼º µÇ¾ú°í ¼ÒÀ¯±Ç ¶ÇÇÑ
JKÀüÀÚ(JK Electronics)ÀÇ °ÍÀÔ´Ï´Ù.
¼ÒÀ¯±ÇÀÚÀÇ Çã°¡¸¦ ¹ÞÁö ¾Ê°í ¹«´ÜÀ¸·Î ¼öÁ¤, »èÁ¦Çϰųª ¹èÆ÷ ÇÒ ¼ö ¾ø½À´Ï´Ù.
|
|
¿Âµµ¼¾¼ DS18B20 ¸ðµâ Atmega128 Á¦¾î ¿¹Á¦
|
|
* Update history
- 2012.9.20 : Ãʱâ Release
|
|
1. Atmega128 Rabbit °³¹ßº¸µå¿Í ¿¬°á ½ÇÇè
(1) Atmega128 Rabbit °³¹ßº¸µå¿Í ¾Æ·¡¿Í °°ÀÌ ¿¬°á(GPIO PC4) ÇÕ´Ï´Ù.
Àü¿øÀº 3.3V/5V ¸ðµÎ »ç¿ë°¡´É ÇÕ´Ï´Ù.
(2) Á¦¾î ¼Ò½º(ATMEGA128 Avrstudio 4.14 Build589 ÇÁ·ÎÁ§Æ® ¼Ò½º ´Ù¿î·Îµå )
GPIO PC4¸¦ ÀÔ·ÂÀ¸·Î ÇÏ¿© ¿Âµµ°ªÀ» ÀÐ¾î ¿É´Ï´Ù.
#include "hw_config.h"
#include "ds18b20.h"
#include "7segment.h"
static float adc_data_float_value = 0.0f;
static u16 adc_data_value = 0;
void main(void)
{
u16 temperature;
CLI(); // all interrupt disable
bsp_fnd_gpio_init();
bsp_ds18b20_gpio_init();
ds18b20_init();
SEI(); // all interrupt enable
while(1)
{
temperature = read_ds18b20_temperature (); // read temperature
temperature *= 0.625; // convert the actual temperature of 10 times;
while (temperature == 850)
{
temperature = read_ds18b20_temperature(); // read temperature
temperature *= 0.625;
_delay_ms (1);
}
// usart_format_puts("temperature=%d\r\n", temperature);
fnd_puts_temperature(temperature, 3);
}
}
|
|
|
|
|
|
|
|
|
|
|
|