Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - az

#1


__disable_interrupt();  // disable interrupt


TCCR0A = 0x02;         // CTC, normal operation
TCCR0B = 0x02;         // prescaler8

OCR0A  = 125;          // set value
TIMSK0 = 0x02;         // Compare Match A Interrupt Enable


TCCR2A = 0x02;         // CTC, normal operation
TCCR2B = 0x02;         // prescaler8

OCR2A  = 125;          // set value
TIMSK2 = 0x02;         // compare match A interrupt enable


//~ TCCR2A = 0x00;         // timer, normal operation
//~ TCCR2B = 0x02;         // prescaler8

//~ TCNT2 = 125;           // set value
//~ TIMSK2  = 0x01;        // Timer/Counter2 Overflow Interrupt Enable


__enable_interrupt();  // enable interrupt

#2
Quote from: septhai on May 19, 2018, 03:13:46 PM
Quote from: az on May 18, 2018, 02:18:54 PM
เพิ่ม mcu เบอร์ใหม่ได้ที่ avrdude.conf
ขอบคุณครับ แต่ผมหมายถึงตัวที่พึ่งซื้อมาใหม่ๆยังไม่เคยโปรแกรมมาก่อนครับ
งั้นน่าจะเกียวกับ driver นะครับ
#3
เพิ่ม mcu เบอร์ใหม่ได้ที่ avrdude.conf
#4
ผมใช้ Bazaar ใช้งานง่าย
Atmel Stduio, IAR workbench, Visual Stduio, Altium project  พวกนี้ใช้ได้หมด



#5
http://www.avrfreaks.net/forums/tutorials

อันนี้พอได้ไหมฮ่ะ
#6
AVR and Arduino / Re: Arduino MEGA328P
November 14, 2017, 11:22:39 AM
Quote from: tha on November 14, 2017, 06:48:35 AM
ใช้ตัวไหน หาซื้อได้ที่ไหนครับ

ลองติดต่อคุณ p_chusak  ดูนะครับ
#7
AVR and Arduino / Re: Arduino MEGA328P
November 13, 2017, 02:55:14 PM
Quote from: tha on November 13, 2017, 01:12:36 PM
พอจะทราบสาเหตุของการเสียแล้วครับ น่าจะมาจาก clock selected มันไม่ต้องกลับบิทครับ ถ้าเราเลือกเป็น Low Power Crystal Oscillator บิท CKSEL[3:1] = 111, ก็ใส่ให้ตรงตามนั้นเลยไม่ต้องกลับบิท บิท SUT[2:1] ด้วย คือ FUSE LOW BYTE กำหนดเป็น 0xFF เลย ไม่ต้องกลับบิทเป็น 0xC0

ถ้าเราโปรแกรมด้วย FUSE LOW BYTE เป็น 0xC0 clock ก็จะกลายเป็น External Clock ไป ต้องเอาสัญญาน clock จากภายนอกเข้าที่ขา XTAL1 ไป จึงทำให้บอร์ดไม่ทำงาน

ทาง ETT แนะนำให้ใช้ oscillator 2MHz ตัวนี้ https://www.es.co.th/detail.asp?Prod=009901724 เป็น External Clock เข้าที่ขา XTAL1 เพื่อให้บอร์ดทำงาน แล้วทำการแก้ CKSEL[3:1] = 111 เลือก clock เป็น  Low Power Crystal Oscillator 16MHz โดยโปรแกรม FUSE LOW BYTE ให้เป็น 0xFF ต่อไป  >:(

รอสั่งซื้อของอีกแล้ว  ;D

จะเล่น fuse bit ใจต้องนิ่งนะครับ
ปล. High Voltage Parallel Programming ไว้แก้ fuse bit
#8
J-Link ใช้กับ Atmel Studio ได้ครับ

ถ้า Atmel Studio มองไม่เห็น J-Link ให้ติดตั้ง J-Link software เพื่อให้  Atmel Studio สามารถดึง  .dll ของ J-Link  มาใช้
https://www.segger.com/downloads/jlink/

ปล. ผมใช้ 7.0