I n t e r n a t i o n a l   J o u r n a l   o f   E l e c t r i c a l   a n d   C o m p u t e r   E n g i n e e r i n g   ( I J E C E )   V o l .   2 ,   N o .   1 ,   F e b r u a r y   2 0 1 2 ,   p p .   1 1 2 ~ 1 1 9   I S S N :   2 0 8 8 - 8 7 0 8             1 1 2       J o u r n a l   h o m e p a g e :   h t t p : / / i a e s j o u r n a l . c o m / o n l i n e / i n d e x . p h p / I J E C E   A V R   M i c r o c o n t r o l l e r   I m p l e m e n t a t i o n   f o r   C u s t o m i z e d   S o u n d   G e n e r a t i o n       1 T a n v i r   H u s s a i n ,   2 M d .   M e j b a u l   H a q u e   1 D e p t .   o f   E l e c t r i c a l   a n d   E l e c t r o n i c   E n g i n e e r i n g ,   Ra j s h a h i   U n i v e r s i t y   o f   E n g i n e e r i n g   &   T e c h n o l o g y ,   Ba n g l a d e s h   2 D e p t .   o f   E l e c t r i c a l   a n d   E l e c t r o n i c   E n g i n e r r i n g ,   K h u l n a   U n i v e r s i t y   o f   E n g i n e e r i n g   &   T e c h n o l o g y ,   K h u l n a - 9 2 0 3 ,   Ba n g l a d e s h .         A r t i c l e   I n f o     A B S T R A C T     A r t i c l e   h i s t o r y :   R e c e i v e d   N o v   1 s t ,   2 0 1 1   R e v i s e d   J a n   1 8 th ,   2 0 1 2   A c c e p t e d   J a n   2 8 th ,   2 0 1 2       I n   t h i s   p a p e r ,   w e   h a v e   p r o p o s e d   a   t e c h n i q u e   b y   w h i c h   c u s t o m i z e d   s o u n d   c a n   b e   g e n e r a t e d   u s i n g   8   b i t   A V m i c r o c o n t r o l l e r .   A n y   s o u n d   f i l e   c h o s e n   f r o m   c o m p u t e r   c a n   b e   i n t e g r a t e d   i n   m i c r o c o n t r o l l e r   p r o g r a m m i n g   w h i c h   i s   w r i t t e n   i n   a n d   c o m p i l e d   b y   A V l i b c   c o m p i l e r .   A n   8   b i t   D A c o n n e c t e d   t o   P O RT   A   o f   A V R   m i c r o c o n t r o l l e r   t a k e s   d a t a   o f   s o u n d   f i l e   a s   i n p u t   a n d   g i v e s   c o n v e r t e d   a n a l o g   s o u n d   s i g n a l   a s   o u t p u t .   A n   a u d i o   a m p l i f i e r   b a s e d   o n   L M 3 8 6   O p - A m p   c i r c u i t   a m p l i f i e s   t h e   s o u n d   s i g n a l   w h i c h   i s   f i n a l l y   c o n n e c t e d   t o   8   s p e a k e r   f o r   a u d i b l e   s o u n d   o u t p u t .   T h i s   c i r c u i t   h a s   b e e n   s i m u l a t e d   u s i n g   P r o t e u s   I S I S   7   V i r t u a l   S y s t e m   M o d e l i n g   ( V S M ) .   K e y w o r d :   D A C   M i c r o c o n t r o l l e r   O p - a m p   S o u n d   g e n e r a t i o n   V S M   Co p y r i g h t   @   2 0 1 2   I n s i t u t e   o f   A d v a n c e d   E n g i n e e e r i n g   a n d   S c i e n c e .     A l l   r i g h t s   r e s e r v e d .   C o r r e s p o n d i n g   A u t h o r :   M d .   M e j b a u l   H a q u e     D e p t .   o f   E l e c t r i c a l   a n d   E l e c t r o n i c   E n g i n e r r i n g   K h u l n a   U n i v e r s i t y   o f   E n g i n e e r i n g   &   T e c h n o l o g y   K h u l n a - 9 2 0 3 ,   B a n g l a d e s h .   E - m a i l :   m h m u k u l . e e e 0 5 @ g m a i l . c o m       1 .   I N T R O D U C T I O N   N o w a d a y s ,   v o i c e   a n d   m u s i c   i n t e g r a t i o n   i n   m o d e r n   h o m e   t o o l s   s u c h   a s   d i s h w a s h e r ,   w a s h i n g   m a c h i n e ,   m i c r o w a v e   o v e n ,   c a l c u l a t o r   e t c .   a n d   i n   i n d u s t r y ,   h u m a n   m a c h i n e   i n t e r a c t i o n   i s   a   c o m m o n   t h i n g .   I n   r o b o t i c s   i t   i s   a l s o   u s e d   e x t e n s i v e l y .   A n y   c u s t o m i z e d   v a l i d   s o u n d   f i l e   w h i c h   r e s i d e s   o n   c o m p u t e r   c a n   b e   i n t e g r a t e d   t o   A V R   G C C   p r o g r a m   a f t e r   e x t r a c t i n g   t h e   s o u n d   f i l e   d a t a   w h i c h   c a n   b e   d o n e   u s i n g   b i n a r y   f i l e   e d i t i n g   s o f t w a r e   s u c h   a s   H e x   E d i t o r   N e o   [ 1 ] .   W e   u s e d   A V R   p r o c e s s o r   b a s e d   m i c r o c o n t r o l l e r   A T m e g a 3 2   [ 2 ] .   C l o c k   f r e q u e n c y   w a s   c h o s e n   a s   1 M H z   a n d   W i n A V R   s o f t w a r e   h a s   b e e n   u s e d   f o r   p r o g r a m m i n g   w h i c h   h a s   b u i l t   i n   l i b c   A V R   c o m p i l e r   [ 3 ] .   A f t e r   w r i t i n g   C   p r o g r a m   w e   h a v e   c o m p i l e d   i t   w h i c h   h a s   g e n e r a t e d   t h e   o b j e c t   c o d e   ( H E X   f i l e ) .   T h e   s o u n d   f i l e   d a t a   h a s   b e e n   k e p t   i n   t h e   F l a s h   m e m o r y   o f   t h e   m i c r o c o n t r o l l e r   a n d   i t   g o e s   t o   D A C   t h r o u g h   P O R T   A   o f   t h e   m i c r o c o n t r o l l e r .   F r o m   a n   a u d i o   a m p l i f i e r   c i r c u i t ,   o u t p u t   h a s   b e e n   t a k e n   w h e r e   a n   8   s p e a k e r   i s   c o n n e c t e d .   F i g .   1   s h o w s   t h e   c o m p l e t e   b l o c k   d i a g r a m   f o r   t h e   s o u n d   g e n e r a t i o n   b y   A V R .       2 .   A U D I O   F I L E   C L A S S I F I C A T I O N   F o r   t r a n s m i s s i o n   a n d   s t o r a g e   p u r p o s e ,   d i f f e r e n t   c o m p r e s s i o n   m e t h o d   o f   a u d i o   h a s   b e e n   d e v i s e d   f o r   m a n y   y e a r s   [ 4 ] .   D u e   t o   d i f f e r e n t   a p p l i c a t i o n   a n d   n e e d ,   t h e r e   a r e   t w o   t y p e s   o f   a u d i o   c o d i n g   m e t h o d   a n d   i s   g i v e n   b e l o w   Evaluation Warning : The document was created with Spire.PDF for Python.
I J E C E     I S S N :   2 0 8 8 - 8 7 0 8       A V R   M i c r o c o n t r o l l e r   I m p l e m e n t a t i o n   f o r   C u s t o m i z e d   S o u n d   G e n e r a t i o n   ( T a n v i r   H u s s a i n )   1 1 3   F i g .   1   C o m p l e t e   b l o c k   d i a g r a m   o f   g e n e r a t i n g   s o u n d   u s i n g   m i c r o c o n t r o l l e r       2 . 1       L O S S L E S S   A U D I O   C O D I N G   L o s s l e s s   a u d i o   c o d i n g   i s   b a s e d   o n   l i n e a r   p r e d i c t i o n   f o l l o w e d   b y   e n t r o p y   c o d i n g   [ 4 ] .   L o s s l e s s   a u d i o   c o d i n g   i s   d i v i d e d   i n t o   t w o   g r o u p s   a s   f o l l o w s     2 . 1 . 1       U N C O M P R E S S E D   T h e r e   a r e   v a r i o u s   f i l e s   f o r m a t   w h i c h   a p p l i e s   u n c o m p r e s s e d   l o s s l e s s   a u d i o   f o r m a t   s u c h   a s   W A V ,   A I F F ,   A U ,   R A W   e t c   [ 5 ] .     2 . 1 . 2       C O M P R E S S E D   L o s s l e s s   c o m p r e s s e d   f i l e   i s   e f f i c i e n t   f o r   s t o r i n g   a u d i o   d a t a   o n   d i s k   b u t   i t   t a k e s   m o r e   p r o c e s s i n g   t i m e   t h a n   l o s s l e s s   u n c o m p r e s s e d   a u d i o   f i l e .   F L A C ,   W a v P a c k ,   A L A C   ( A p p l e   l o s s l e s s )   e t c .   f i l e   a p p l i e s   t h i s   f o r m a t   [ 5 ] .       2 . 2         L O S S Y   A U D I O   C O D I N G   L o s s y   a u d i o   c o d i n g   m a k e s   u s e   o f   a   p s y c h o a c o u s t i c   m o d e l   o f   h u m a n   a c o u s t i c   p e r c e p t i o n   t o   q u a n t i z e   a n d   c o d e   t h e   a u d i o   s i g n a l   [ 4 ] .   M P 3 ,   V o r b i s ,   M u s e p a c k ,   A A C ,   A T R A C   e t c   a p p l i e s   l o s s y   a u d i o   c o d i n g   [ 5 ] .       3 .   D A T A   E X T R A C T I O N   F R O M   A U D I O   F I L E   I n   o u r   d e s i g n   w e   h a v e   a p p l i e d   W A V   f i l e   f o r m a t   a s   i n   t h i s   f i l e   f o r m a t   n o   d e c o d i n g   i s   n e e d e d .   T o   c o n v e r t   a n y   a u d i o   f i l e   t o   W A V   f i l e   f o r m a t   w e   h a v e   u s e d   S W I T C H   S o u n d   F i l e   C o n v e r t e r   S o f t w a r e   [ 6 ] .   W e   h a v e   u s e d   8   b i t   D A C   a n d   o n e   s p e a k e r . T h a t   i s   w h y ,   a n y   a u d i o   f i l e   h a s   t o   b e   c o n v e r t e d   t o   W A V   f i l e   c o n t a i n i n g   t h e s e   s p e c i f i c a t i o n ,   u n c o m p r e s s e d   P C M   f o r m a t ,   8 - b i t   M o n o   a n d   s a m p l i n g   r a t e   i s   8   K H z .   H e r e ,   8 - b i t   d a t a   t a k e s   1   b y t e   s p a c e   i n   m e m o r y   a n d   t h e r e   a r e   8 0 0 0   s a m p l e   p e r   s e c o n d .   S o   1   s e c o n d   s o u n d   f i l e   t a k e s   8 K b y t e   s p a c e   i n   m e m o r y .   I n   t h i s   p r o j e c t   w e   h a v e   a p p l i e d   3   s e c o n d   s o u n d   a s   A t m e g a 3 2   h a s   m a x i m u m   3 2 K b y t e   F l a s h   m e m o r y .   F i g .   2   s h o w s   t h e   s n a p s h o t   o f   S w i t c h   s o u n d   f i l e   c o n v e r t e r   s o f t w a r e .   F r o m   t h e   m e n u   b a r   o f   S w i t c h   s o u n d   f i l e   c o n v e r t e r   s o f t w a r e   w e   h a v e   t o   g o   F i l e > A d d   F i l e ( s )   o r   h a v e   t o   p r e s s   c t r l + A   f r o m   k e y b o a r d .   S e l e c t i n g   t h e   d e s i r e d   f i l e   w e   h a v e   t o   c l i c k   o n   E n c o d e r   O p t i o n   b u t t o n   i n   t h e   l e f t   b o t t o m   c o r n e r   o f   t h e   s o f t w a r e .   H e r e   a   w i n d o w   w i l l   p o p   u p   w h e r e   d e s i r e d   c h a n g e s   f o r   t h e   o u t p u t   s o u n d   f i l e   a r e   s e l e c t e d .   F i n a l l y   p r e s s i n g   t h e   C o n v e r t   b u t t o n   o n   r i g h t - b o t t o m   c o r n e r   w i l l   c o n v e r t   t h e   s o u n d   f i l e   t o   o u r   d e s i r e d   s o u n d   f i l e   f o r m a t .     A f t e r   c o n v e r t i n g   a n y   s o u n d   f i l e   t o   W A V   f i l e ,   w e   h a v e   t o   o p e n   o u r       d e s i r e d             f i l e   u s i n g   H e x   E d i t o r   N e o .   U s i n g   t h i s   s o f t w a r e ,   w e   h a v e   e x t r a c t e d   t h e   d a t a   i n   d e c i m a l   f o r m a t   a n d   c o p i e d   i t   i n   a   t e x t   f i l e .   L a t e r   t h e   e x t e n s i o n   o f   t h e   f i l e   c o n t a i n i n g   t h e   s o u n d   d a t a   h a s   b e e n   c h a n g e d   t o   * . h .   A s   t h i s   s o u n d   h a s   b e e n   s a m p l e d   i n   8   k H z   8 - b i t   m o n o   m o o d ,   w e   h a v e   s e n t   e v e r y   s a m p l e   t o   t h e   D A C   f r o m   m i c r o c o n t r o l l e r   e v e r y   1 2 5   µ s   i n t e r v a l   a s   m i c r o c o n t r o l l e r   i s   s e t   t o   r u n   a t   1 M H z   f r e q u e n c y .           Evaluation Warning : The document was created with Spire.PDF for Python.
                                I S S N :   2 0 8 8 - 8 7 0 8   I J E C E     V o l .   2 ,   N o .   1 ,     F e b r u a r y   2 0 1 2   :     1 1 2     1 1 9   1 1 4     F i g .   2   S n a p s h o t   o f   S w i t c h   S o u n d   F i l e   C o n v e r t e r   w i t h   w a v e   e n c o d e r   o p t i o n       F i g .   3   s h o w s   H e x   E d i t o r   N e o   s o f t w a r e   o v e r v i e w .   I n   t h i s   s o f t w a r e ,   f r o m   m e n u   b a r   w e   h a v e   t o   o p e n   o u r   d e s i r e d   W A V   f i l e   f r o m   F i l e >   O p e n   >   F i l e   O p e n .   A f t e r   o p e n i n g   t h e   a u d i o   f i l e ,   t h e   b i n a r y   d a t a   o f   t h e   f i l e   w i l l   b e   s h o w n   i n   t h i s   w i n d o w .   w e   c a n   c o p y   o u r   r e q u i r e d   d a t a   f r o m   t h i s   o p e n e d   w i n d o w   t o   a   t e x t   f i l e .   L a t e r   t h e   e x t e n s i o n   o f   t h e   t e x t   f i l e   h a v e   t o   b e   c h a n g e d   f r o m   * . t x t         t o   * . h .         F i g .   3   H e x   E d i t o r   N e o   w i t h   w a v   f i l e   o p e n e d   i n   w i n d o w   Evaluation Warning : The document was created with Spire.PDF for Python.
I J E C E     I S S N :   2 0 8 8 - 8 7 0 8       A V R   M i c r o c o n t r o l l e r   I m p l e m e n t a t i o n   f o r   C u s t o m i z e d   S o u n d   G e n e r a t i o n   ( T a n v i r   H u s s a i n )   1 1 5   4 .   D I G I T A L   T O   A N A L O G   C O N V E R T E R   I n   e l e c t r o n i c s ,   a   d i g i t a l   t o   a n a l o g   c o n v e r t e r   ( D A C )   c o n v e r t s   b i n a r y   c o d e   t o   a n a l o g   s i g n a l .   T h e r e   a r e   v a r i o u s   t y p e s   a n d   c i r c u i t s   f o r   D A C   b u t   i n   t h i s   w o r k   w e   h a v e   u s e d   R - 2 R   r e s i s t o r   l a d d e r   d i g i t a l   t o   a n a l o g   c o n v e r t e r   c i r c u i t   [ 7 ] - [ 9 ] .   A   b a s i c   R - 2 R   r e s i s t o r   l a d d e r   n e t w o r k   i s   s h o w n   i n   F i g .   4 .         F i g .   4   R e s i s t o r   l a d d e r   d i g i t a l   t o   a n a l o g   c o n v e r t e r   c i r c u i t       B i t   7   M S B   ( m o s t   s i g n i f i c a n t   b i t )   t o   B i t   0   L S B   ( l e a s t   s i g n i f i c a n t   b i t )   a r e   d r i v e n   f r o m   m i c r o c o n t r o l l e r   p o r t s .   I d e a l l y ,   t h e   b i t s   a r e   s w i t c h e d   b e t w e e n   0   v o l t s   ( d i g i t a l   0 )   a n d   V r e f   ( d i g i t a l   1 )   [ 1 0 ] .   T h e   R - 2 R   n e t w o r k   c a u s e s   t h e   d i g i t a l   b i t s   t o   b e   w e i g h t e d   i n   t h e i r   c o n t r i b u t i o n   t o   t h e   o u t p u t   v o l t a g e   V o u t .   I n   t h i s   c i r c u i t   8   b i t s   a r e   s h o w n ,   g i v i n g   2 5 6   p o s s i b l e   o u t p u t s .   D e p e n d i n g   o n   w h i c h   b i t s   a r e   s e t   t o   1   a n d   w h i c h   t o   0   t h e   o u t p u t   v o l t a g e   ( V o u t )   w i l l   b e   a   s t e p p e d   v a l u e   b e t w e e n   0   v o l t s   a n d   V r e f   m i n u s   t h e   v a l u e   o f   t h e   m i n i m u m   s t e p ,   b i t   0 .   T h e   a c t u a l   v a l u e   o f   V r e f   a n d   0   v o l t s n   w i l l   d e p e n d   o n   t h e   t e c h n o l o g y   o f   t h e   d i g i t a l   l o g i c   g a t e s   u s e d   t o   d r i v e   b i t   8 - 0 .   I n   o u r   c a s e   w e   w i l l   d r i v e   o u r   m i c r o c o n t r o l l e r   b y   s t a n d a r d   + 5   V o l t   s u p p l y   a n d   s o   V r e f   w i l l   b e   5 V .   F o r   a   d i g i t a l   v a l u e   V A L ,   o f   a   R - 2 R   D A C   o f   N   b i t s   o f   0   V / V r e f ,   t h e   o u t p u t   v o l t a g e   V o u t   i s   g i v e n   i n   [ 1 0 ]   a s   N 2 V A L r e f V o u t V ´ =                                         ( 1 )   I n   t h i s   p a p e r   w e   h a v e   c o n s i d e r e d   8   b i t   D A C ,   s o   N = 8   a n d   h e n c e   2 N = 2 5 6   w i t h   V r e f = 5   V .   S o   V A L   w i l l   v a r y   b e t w e e n   0 b 0 0 0 0 0 0 0   t o   0 b 1 1 1 1 1 1 1 .   S o   w e   h a v e   f r o m   e q u a t i o n   ( 1 )   t h e   m i n i m u m   v a l u e   o f   V A L   w i l l   b e   ( 0 0 0 0 0 0 0 1   =   1 )   a n d   m a x i m u m   v a l u e   o f   V A L   w i l l   b e   ( 1 1 1 1 1 1 1 1   =   2 5 5 )   V o t l s     0 . 0 1 9 5 2 5 6 1 5 o u t V = ´ =                       ( 2 )   V o l t s   4 . 9 8 0 4   8 2 2 5 5 5 o u t V = ´ =                           ( 3 )   S o   t h e   o u t p u t   v o l t a g e   o f   t h e   D A C   w i l l   s w i n g   b e t w e e n   0 . 0 1 9 5 V   t o   4 . 9 8 0 4 V .     5 .   A U D I O   A M P L I F I E R   T h e   o u t p u t   s i g n a l   p o w e r   f r o m   D A C   i s   v e r y   w e a k   t o   d r i v e   a   s p e a k e r .       T o       g e t       n o t a b l e       a n d       a u d i b l e   s o u n d ,   a n   a u d i o a m p l i f i e r   c i r c u i t   i s   u s e d   s h o w n   i n   F i g .   5 .   T h i s   s i m p l e   a m p l i f i e r   s h o w s   t h e   L M 3 8 6   i n   a   h i g h - g a i n   c o n f i g u r a t i o n   ( A   =   2 0 0 ) .   F o r   a   m a x i m u m   g a i n   o f   o n l y   2 0 ,   t h e   1 0   µ F   c a p a c i t o r   c o n n e c t e d   f r o m   p i n   1   t o   p i n   8   h a s   t o   b e   r e m o v e d .   M a x i m u m   g a i n s   b e t w e e n   2 0   a n d   2 0 0   m a y   b e   r e a l i z e d   b y   a d d i n g   a   s e l e c t e d   Evaluation Warning : The document was created with Spire.PDF for Python.
                                I S S N :   2 0 8 8 - 8 7 0 8   I J E C E     V o l .   2 ,   N o .   1 ,     F e b r u a r y   2 0 1 2   :     1 1 2     1 1 9   1 1 6 r e s i s t o r   i n   s e r i e s   w i t h   t h e   s a m e   1 0   µ F   c a p a c i t o r .   T h e   1 0 k   p o t e n t i o m e t e r   w i l l   g i v e   t h e   a m p l i f i e r   a   v a r i a b l e   g a i n   f r o m   z e r o   u p   t o   t h e   m a x i m u m   [ 1 1 ] .                         F i g .   5   S c h e m a t i c   c i r c u i t   d i a g r a m   f o r   a u d i o   a m p l i f i e r       6 .   C I R C U I T   D I A G R A M             F i g .   6   s h o w s   t h e   c o m p l e t e   c i r c u i t   d i a g r a m .   T h e   r e s i s t o r   l a d d e r   R - 2 R   D A C   i s   c o n n e c t e d   t o   t h e   m i c r o c o n t r o l l e r   t h r o u g h   P O R T   A   a n d   t h e   x   m a r k e d   p l a c e   s h o w s   t h e   o u t p u t   o f   t h e   D A C .   I t   i s   t h e n   f e d   t o   t h e   a u d i o   a m p l i f i e r   c i r c u i t .   T h i s   c i r c u i t   a m p l i f i e s   t h e   p o w e r   o f   t h e   i n p u t   a u d i o   s i g n a l .   G e n e r a t e d   s o u n d   i s   p r o d u c e d   b y   a n   8   s p e a k e r .   T h e   m i c r o c o n t r o l l e r   i s   p o w e r e d   f r o m   s t a n d a r d   + 5 V   p o w e r   s u p p l y   a n d   t h e   a u d i o   a m p l i f i e r   n e e d s   + 9 V   p o w e r   s u p p l y   f o r   s m o o t h   o p e r a t i o n .       F i g .   6   C o m p l e t e   c i r c u i t   d i a g r a m   o f   t h e   s o u n d   g e n e r a t i o n   s y s t e m   u s i n g   A V R   b a s e d   m i c r o c o n t r o l l e r       7 .   A V R   G C C   P R O G R A M   A V R   G C C   i s   t h e   m o s t   p o p u l a r   c   c o m p i l e r   f o r   p r o g r a m m i n g   A V R   b a s e d   m i c r o c o n t r o l l e r   a s   i t   i s   c o m p l e t e l y   f r e e   [ 1 2 ] .   I t   a l s o   h a s   s o m e   i n h e r e n t   a d v a n t a g e s   o v e r   s o m e   t r a d i t i o n a l   c   c o m p i l e r   [ 1 3 ] .   T h e   p r o g r a m   f o r   t h e   m i c r o c o n t r o l l e r   h a s   b e e n   w r i t t e n   i n   C   a n d   c o m p i l e d   w i t h   A V R   G C C .   T h e   s o u n d   f i l e   d a t a   h a s   b e e n   p l a c e d   i n   a   f i l e   c a l l e d   d a t a . h   a n d   i n c l u d e d   i n   t h e   p r o g r a m ,   t h e n   a   l o o p   r e a d s   t h o s e   d a t a   o n e   b y   o n e   a n d   s e n d s   t o   D A C   c o n n e c t e d   t o   P O R T A   a f t e r   e v e r y   1 2 5 µ s ,   d u e   t o   s o u n d   h a s   b e e n   r e - s a m p l e d   a t   8   K H z   8   b i t   W A V   m o d e   a s   d e s c r i b e d   b e f o r e .   F i g .   7   s h o w s   t h e   f l o w   c h a r t   o f   t h e   m a i n   C   p r o g r a m .       8 .   S I M U L A T I O N   A N D   R E S U L T   D A C   c i r c u i t   c o n n e c t e d   t o   A T m e g a 3 2   c a n   b e   s i m u l a t e d   u s i n g   P r o t e u s   I S I S   7   V S M .   F i g .   1 0   s h o w s   t h e   c i r c u i t   w e   j u s t   d e s c r i b e d   b e f o r e   d r a w n   i n   P r o t e u s .   T o   c h e c k   i f   o u r   c i r c u i t   r e a l l y   w o r k s ,   f i r s t   w e   s e n t   a   c o n t i n u o u s   d a t a   f r o m   m i c r o c o n t r o l l e r   t o   D A C   r a n g i n g ,   b i n a r y   0 0 0 0 0 0 0 0   t o   b i n a r y   d a t a   1 1 1 1 1 1 1 1   w i t h   1   i n c r e m e n t .   L i n e a r l y   i n c r e m e n t i n g   t h e   d a t a   w i l l   a l s o   i n c r e a s e   t h e   o u t p u t   v o l t a g e   a c c o r d i n g l y   a s   s h o w n   i n   e q u a t i o n   ( 1 ) .   I f   t h i s   p r o c e s s   l o o p s   b a c k   t h a n   o n   o s c i l l o s c o p e   w e   w i l l   s e e   a   t r i a n g u l a r   w a v e   s h o w n   i n   F i g .   8 .     I n   n e x t   s t e p   w e   h a v e   l o a d e d   o u r   h e x   f i l e   t o   t h e   m i c r o c o n t r o l l e r   a n d   t h e   s o u n d   o u t p u t   v o l t a g e   g r a p h   s h o w n   i n   F i g .   9   f r o m   P r o t e u s   I S I S   7   V S M   o s c i l l o s c o p e .     Evaluation Warning : The document was created with Spire.PDF for Python.
I J E C E     I S S N :   2 0 8 8 - 8 7 0 8       A V R   M i c r o c o n t r o l l e r   I m p l e m e n t a t i o n   f o r   C u s t o m i z e d   S o u n d   G e n e r a t i o n   ( T a n v i r   H u s s a i n )   1 1 7                                                   F i g .   7   F l o w   c h a r t   o f   t h e   m a i n   c   p r o g r a m                           F i g .   8   T r i a n g u l a r   w a v e   o n   p r o t e u s   o s c i l l o s c o p e   w h e n   D A C   i s   f e d   b y   l i n e a r   i n c r e a s i n g l y   d a t a         F i g .   9   S o u n d   s i g n a l   o n   p r o t e u s   o s c i l l o s c o p e     Evaluation Warning : The document was created with Spire.PDF for Python.
                                I S S N :   2 0 8 8 - 8 7 0 8   I J E C E     V o l .   2 ,   N o .   1 ,     F e b r u a r y   2 0 1 2   :     1 1 2     1 1 9   1 1 8 I n   F i g .   1 0   w e   h a v e   d r a w n   t h e   r e s i s t o r   l a d d e r   R - 2 R   D A C   w i t h   m i c r o c o n t r o l l e r   a n d   w e   p l a c e d   a n   o s c i l l o s c o p e   t o   v i e w   t h e   o u t p u t   w a v e   s h a p e   a t   p o i n t   V 0 .         F i g .   1 0   S i m u l a t i o n   o f   t h e   s o u n d   g e n e r a t i o n   s y s t e m   u s i n g   A V R   b a s e d   m i c r o c o n t r o l l e r   u s i n g   P r o t e u s       9 .   C O N C L U S I O N         I n   t h i s   p a p e r ,   c u s t o m i z e d   s o u n d   g e n e r a t i o n   t e c h n i q u e   h a s   b e e n   s h o w n   i n   d e t a i l   i m p l e m e n t i n g   m i c r c o n t r o l l e r .   N o t   o n l y   A T m e g a 3 2   m i c r o c o n t r o l l e r   b u t   a l s o   a n y   8 - b i t   m i c r o c o n t r o l l e r   c a n   b e   u s e d   f o r   t h i s   p u r p o s e .   P I C   m i c r o c o n t r o l l e r   w i l l   a l s o   s e r v e   t h e   p u r p o s e .   I f   i t   i s   n e c e s s a r y   t o   s t o r e   a   l a r g e   s o u n d   f i l e ,   t h e n   M M C   o r   S D   c a r d   c a n   b e   u s e d .   M M C   o r   S D   c a r d   c a n   c o m m u n i c a t e   w i t h   m i c r o c o n t r o l l e r   w i t h   i t s   S P I   p r o t o c o l   [ 1 4 ] .   I n   s u m m a r y   t h e   w h o l e   p r o c e s s   i s   l i k e   t h i s :   i .   C o n v e r s i o n   o f   o u r   d e s i r e d   s o u n d   f i l e   f o r m a t   t o   W A V   s o u n d   f o r m a t .   i i .   E x t r a c t i o n   o f   s o u n d   d a t a .   i i i .   I n t e g r a t i o n   o f   t h e   s o u n d   d a t a   i n   m a i n   c   p r o g r a m .   i v .   C o m p i l i n g   t h e   c   p r o g r a m .   v .   P r o g r a m m i n g   t h e   m i c r o c o n t r o l l e r   w i t h   t h e   g e n e r a t e d   H E X   f i l e .   v i .   C o n n e c t i n g   t h e   c i r c u i t   a s   s h o w n   i n   F i g .   6   v i i .   S i m u l a t i o n   o f   t h e   s o u n d   g e n e r a t i o n   s y s t e m   i s   s h o w n   i n   F i g .   1 0   u s i n g   P r o t e u s   v i i i .   T e s t i n g   o f   t h e   c i r c u i t   i n   r e a l   w o r l d .       R E F E R E N C E S       [ 1 ]   H e x   E d i t o r   N e o   w e b s i t e .   [ O n l i n e ] .   A v a i l a b l e :   h t t p : / / w w w . h h d   s o f t w a r e . c o m / f r e e - h e x - e d i t o r .   [ 2 ]   T h e   A t m e l   w e b s i t e .   [ O n l i n e ] .   A v a i l a b l e :   h t t p : / / w w w . a t m e l . c o m /   d y n / p r o d u c t s / p r o d u c t _ c a r d . a s p ? p a r t _ i d = 2 0 1 4   [ 3 ]   W i n A V w e b s i t e .   [ O n l i n e ] .   A v a i l a b l e :   h t t p : / / w i n a v r . s o u r c e f o r g   e . n e t /       [ 4 ]   U d o   Z o l z e r ,   D i g i t a l   A u d i o   S i g n a l   P r o c e s s i n g ,   2 n d   e d i t i o n ,   A n t o n y   Ro w e   L t d . ,   Ch i p p e n h a m ,   E n g l a n d :   W i l e y   &   S o n s ,   2 0 0 8   [ 5 ]   W i k i p e d i a   w e b s i t e .   [ O n l i n e ] .   A v a i l a b l e :   h t t p : / / e n . w i k i p e d i a . o r g /   w i k i / A u d i o _ f i l e _ f o r m a t       [ 6 ]   T h e   S w i t c h   A u d i o   F i l e   Co n v e r t e r   w e b s i t e .   [ O n l i n e ] .   A v a i l a b l e :     h t t p : / / w w w . n c h . c o m . a u / s w i t c h / i n d e x . h t m l   [ 7 ]   M a r k   Ba l c h ,   Co m p l e t e   D i g i t a l   D e s i g n , 1 s t   e d i t i o n ,   Ne Y o r k ,   M c G r a w - H i l l ,   2 0 0 3   [ 8 ]   A l l   A b o u t   Ci r c u i t s   w e b s i t e .   [ O n l i n e ] .   A v a i l a b l e :   h t t p : / / w w w . a l l a   b o u t c i r c u i t s . c o m / v o l _ 4 / c h p t _ 1 3 / 3 . h t m l   [ 9 ]   M i c h a e l   P e t e r   K e n n e d y ,   O n   t h e   Ro b u s t n e s s   o f   R - 2 L a d d e r   D A C,   I E E E   T r a n s a c t i o n s   o n   Ci r c u i t s   a n d   S y s t e m s ,   V o l .   4 7 ,   N o .   2 ,   p p .   1 0 9 - 1 1 6 ,   F e b .   2 0 0 0 .   [ 1 0 ]     W i k i p e d i a   w e b s i t e .   [ O n l i n e ] .   A v a i l a b l e :   h t t p : / / e n . w i k i p e d i a . o r g /   w i k i / Re s i s t o r _ l a d d e r   [ 1 1 ]     T e c h l i b   w e b s i t e .   [ O n l i n e ] .   A v a i l a b l e :   h t t p : / / w w w . t e c h l i b . c o m / e   l e c t r o n i c s / a u d i o a m p s . h t m l     [ 1 2 ]     A V L i b c   w e b s i t e .   [ O n l i n e ] .   A v a i l a b l e :   h t t p : / / w w w . n o n g n u . o r g /   a v r - l i b c /   [ 1 3 ]     T .   F r y z a ,   Ba s i c   Co d e   I m p l e m e n t a t i o n s   f o r   A V M i c r o c o n t r o l l e r ,   1 4 t h   I n t e r n a t i o n a l   W o r k s h o p   o n   S i g n a l s ,   S y s t e m s   a n d   I m a g e   P r o c e s s i n g ,   p p .   4 3 4 - 4 3 7 ,   N o v .   2 0 0 7 .       [ 1 4 ]     M u l t i m e d i a   Ca r d ,   ( A D E 2 0 3 - 1 2 9 4 C) ,   H i t a c h i ,   A p r .   2 6 ,   2 0 0 2 .     Evaluation Warning : The document was created with Spire.PDF for Python.
I J E C E     I S S N :   2 0 8 8 - 8 7 0 8       A V R   M i c r o c o n t r o l l e r   I m p l e m e n t a t i o n   f o r   C u s t o m i z e d   S o u n d   G e n e r a t i o n   ( T a n v i r   H u s s a i n )   1 1 9 B I B L I O G R A P H Y   O F   A U T H O R S           Ta n v i r   H u s s a i n   w a s   b o r n   o n   N o v   1 3   1 9 8 9 .   H e   h a s   r e c e i v e d     h i s   BS c .   E n g i n e e r i n g   f r o m   t h e   D e p t .   o f   E l e c t r i c a l   a n d   E l e c t r o n i c   E n g i n e e r i n g   a t   Ra j s h a h i   U n i v e r s i t y   o f   E n g i n e e r i n g   & T e c h n o l o g y ,   Ra j s h a h i ,   Ba n g l a d e s h . H i s   r e s e a r c h   i n t e r e s t s   m a i n l y   a r e   Ci r c u i t s   a n d   S y s t e m s :   t h e o r y ,   d e s i g n   a n d   i m p l e m e n t a t i o n .   H e   h a s   c o - a u t h o r e d   4   p u b l i c a t i o n s   i n c l u d i n g   t w o   I n t e r n a t i o n a l     j o u r n a l   a n d   c o n f e r e n c e   p a p e r s . T a n v i r   H u s s a i n   i s   a   m e m b e r   o f   I E E E   W o m e n   i n   E n g i n e e r i n g   ( W I E ) ,   I E E E   c i r c u i t s   a n d   S y s t e m s   s o c i e t y ,   I E E E   P o w e r   e l e c t r o n i c s   s o c i e t y   a n d   I E E E   s o l i d - s t a t e   c i r c u i t s   s o c i e t y .   T a n v i r   H u s s a i n   w i t h   h i s   t e a m   w a s   a w a r d e d   f i r s t   i n   I E E E   e t h i c s   c o m p e t e t i o n ,   I E E E   Ba n g l a d e s h   S e c t i o n ,   S P A 2 0 1 0 .   H e       a l s o   g o t   m e r i t   b a s e d   t e c h n i c a l   s c h o l a r s h i p   f r o m   Ra j s h a h i   U n i v e r s i t y   o f   E n g i n e e r i n g   a n d   T e c h n o l o g y             M d .   M e j b a u l   H a q u e   w a s   b o r n   i n   K u s h t i a ,   Ba n g l a d e s h   o n   S e p t e m b e r   2 7 ,   1 9 8 8 .   H e   r e c e i v e d   h i s   B. S c .   E n g i n e e r i n g   D e g r e e   f r o m   Ra j s h a h i   U n i v e r s i t y   o f   E n g i n e e r i n g   &   T e c h n o l o g y   ( RU E T ) ,   Ba n g l a d e s h ,   i n   A p r i l   1 9 ,   2 0 1 0   i n   E l e c t r i c a l   a n d   E l e c t r o n i c   E n g i n e e r i n g .   H e   p u b l i s h e d   t h r e e   c o n f e r e n c e   p a p e r s .   H e   i s   c u r r e n t l y   w o r k i n g   a s   a   L e c t u r e r   i n   E l e c t r i c a l   a n d   E l e c t r o n i c   E n g i n e e r i n g   D e p a r t m e n t ,   K U E T .   H i s   r e s e a r c h   i n t e r e s t s   a r e   P o w e r   s y s t e m   s t a b i l i t y ,   P o w e r   q u a l i t y   i m p r o v e m e n t   a n d   Re n e w a b l e   E n e r g y .   M d .   M e j b a u l   H a q u e   i s   t h e   a s s o c i a t e   m e m b e r   o f   t h e   I E o f   Ba n g l a d e s h .               Evaluation Warning : The document was created with Spire.PDF for Python.