336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

우선 설치해야할건 FT232 Driver이다.

장치관리자로 들어가면 아래 그림처럼 FT232 Error를 확인할수있다.

CDM20802 WHQL Certified.zip

▲압축해제후 위 그림의 FT232에 우클릭후 

드라이버 소프트웨어 업데이트 선택

PL2303_Prolific_DriverInstaller_v1180B.zip



▼컴퓨터에서 드라이버 소프트웨어 찾아보기


▼압축 해제한 경로를 찾아가서


▼아래 그림처럼 새로운 포트가 잡혔다면 성공이다.

만약 범용 직렬버스 컨트롤러에 잡혔다면

우클릭후 제거를 누르고, 위 과정을 다시 반복해서 아래 그림처럼 뜰때까지 시도하면 된다.







rxtx Echo Test

Check 4 connections of PL2303.

and bridge both RX,TX pins with Jumper.


install Putty program

putty.zip


Check한다. Device Manager를

장치 관리자에서 COM포트를 확인후

Putty에서도 맞춰준다.

맞춰야할것들은 Serial line, Speed, Connection type 이다.

Logging 을 클릭하고,

Always overwrite it 을 체크한다.

이제 Open을 누르고, SpaceBar를 눌러서 반응하면 PL2303은 정상적으로 동작하는 것이다.


---------------------------------------------------------------------------

회로를 만들기위해선 아래 자료를 참고해야한다.

참고사이트(◀링크)

코드 바로 보고싶을때 ▼

https://raw.githubusercontent.com/sisalina/AVR-programming/master/analog_read.c

여기서 쓰인칩은 ATmega168이다.

중요포인트는 이 칩의 7,8번 핀이 각각 Vcc, GND에 연결했다는점

ADC3가 POT의 가운데 핀에 연결된다는점

Rx,Tx를 뽑아서 crossed되게 어긋나게 연결해야한다는점

AREF, AVCC가 short되서 Vcc로 합쳐져서 연결된다는 점이다. 

이걸 ATmega128에 적용하면 똑같은 결과가 나온다.

(참고로 ATmega128사용시 E0,E1이 각각 Rx,Tx에 해당한다.)

(F3핀이 POT의 가운데핀에 연결된다.)

(AREF, AVCC는 short시켜서 Vcc에 연결하는걸 잊지말아야한다.)

(VCC, GND는 기본이니 더 말하면 입아프겠지.)


FT232모듈에서 5V,VCCIO, 3V가 있다면

VCCIO & 3V를 Jumper로 Bridge시킨다.

그리고 5V출력을 뽑아서 ATmega128칩의 Vcc에 연결한다.

Putty를 통해서 다음과 같은 출력을 얻었다면 성공이다.



NS-AT128 (늘솜) 제품은 AVCC와 VCC가 내부적으로 연결되어있으므로

AREF만 따로 뽑아서 VCC에 연결해주면 ADC값을 출력할 수 있다.

------------------------------------------------------------------------------------------

http://extremeelectronics.co.in/avr-tutorials/using-the-usart-of-avr-microcontrollers-reading-and-writing-data/

AVR Studio 기반코드

자판 타이핑하면 FeedBack 되는 기본코드


사용한 MCU : ATmega 8 (Atmega128로 변경하려면 Register를 약간 변경시켜야한다.)

Sample program to use AVR USART

여기 부분의 코드를 사용하면 된다.


Posted by ElectricShock
:
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

Refer to HERE

Hi everyone,

I am trying to make an interface between an android phone and microcontroller using the HC-06 Bluetooth module.

인터페이스를 만들려한다. between 안드로이드 폰 & 마이크로컨트롤러사이에 using the HC-06을 써서.

I started this morning by trying it out on Arduino UNO

and as there are many tutorials on the internet about the same, 

I managed in perhaps the first hour to send characters from my phone.


But am a fan of PIC microcontrollers and so I decided to go for the major adventure of the day.

As it however turns out about 12 hours later, its turning into a nightmare.


I can pair with my phone and initialize the UART communication without problems.

난 페어할수있었다. with 내폰과 and 초기화할수있었다. the UART 통신을 without 문제없이.

When I start typing, I can also tell that there is signal being detected by my PIC.

when 내가 start 타이핑하기시작했을때 난 can also 말할수있었다. there is 시그널이있다고. being 감지되는 by 내 PIC에 의해.

But there seems to be no data transfer except for an error.

But 없어보인다. 데이터 송신자가 except for an 에러빼고.

What could be wrong with my code.

I'm using MikroC and MPLab with PICKIT3 and Blueterm2 in Android phone.


unsigned short counter=0;

void interrupt() {
  if (INTCON.TMR0IF) {
    if (counter >= 20) {
      Soft_UART_Break();
      counter = 0;              // reset counter
    }
    else
      counter++;                // increment counter
    INTCON.TMR0IF = 0;            // Clear Timer0 overflow interrupt flag
    }
}

void main(){
unsigned char error, datain, byte_read=0, i, k=100, j=9, l=200;
    TRISB.F3=0;
    TRISA=0;
    PORTB=0;
    PORTA=0;
    ANSEL=0;
    CMCON=7;
    OSCCON=0B01001100;
     OPTION_REG = 0x04;            // TMR0 prescaler set to 1:32
      TMR0=0;
      INTCON.TMR0IE = 0;              // Enable Timer0 overflow interrupt
      
    for(i=0; i<3; i++){
        PORTA=255;
        Delay_ms(100);
        PORTA=0;
        Delay_ms(100);
        }
    
    error = Soft_UART_Init(&PORTB, 4, 5, 9600, 0);
    Eeprom_Write(0x00, error);
  if (error > 0) {
         Eeprom_Write(0x01, error);
         delay_ms(10);
         /*PORTA=error;  Delay_ms(30);
         PORTA=0;  Delay_ms(30);*/
    while(1);                            // Stop program
  }
  Delay_ms(100);

  while(1) {                              // Endless loop
      INTCON.GIE = 1;               // Global interrupt enable
      INTCON.TMR0IE = 1;              // Enable Timer0 overflow interrupt
    byte_read = Soft_UART_Read(&error);   // Read byte, then test error flag
        INTCON.GIE = 0;                                         // Global interrupt disable
      INTCON.TMR0IE = 0;              // Disable Timer0 overflow interrupt
    if(error==0){     
          Eeprom_Write(j, byte_read);	//save data in Eeprom
          j+=1;  if(j>200) j=9;
          PORTA=3;  Delay_ms(30);		
          Eeprom_Write(0x04, j);		////save number of characters in Eeprom
          PORTA=0;  Delay_ms(30);
          PORTA = byte_read;
          //Eeprom_Write(j, byte_read);
      }
      else Eeprom_Write(0x05, error);	//save error message in Eeprom

  }
}

---------------------------------------------------------------------------

Refer to Here.

Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// LCD module connections
sbit LCD_RS at PORTB2_bit;
sbit LCD_EN at PORTB3_bit;
sbit LCD_D4 at PORTB4_bit;
sbit LCD_D5 at PORTB5_bit;
sbit LCD_D6 at PORTB6_bit;
sbit LCD_D7 at PORTB7_bit;
 
sbit LCD_RS_Direction at DDB2_bit;
sbit LCD_EN_Direction at DDB3_bit;
sbit LCD_D4_Direction at DDB4_bit;
sbit LCD_D5_Direction at DDB5_bit;
sbit LCD_D6_Direction at DDB6_bit;
sbit LCD_D7_Direction at DDB7_bit;
// End LCD module connections
 
 
unsigned char ackPacket[64] = "";
unsigned int i = 0;
unsigned char processAck = 0, cmd = 0;
 
#define Lo(param) ((char *)&param)[0]
#define Hi(param) ((char *)&param)[1]
#define Higher(param) ((char *)&param)[2]
#define Highest(param) ((char *)&param)[3]
 
const unsigned int gheader = 0xEF01;
unsigned long goriginalModuleAddress = 0xFFFFFFFF;
unsigned long gnewModuleAddress = 0xAABBCCDD;
unsigned long gmoduleAddress = 0xFFFFFFFF;
unsigned long gchipAddress = 0xFFFFFFFF;
unsigned long int gpassword = 0xABCDEF01;
unsigned short gturnOnPort = 1, gturnOffPort = 0;
unsigned short gbufferID = 0, gpageNum2 = 0;
unsigned int gpageID = 0, gnoOfTemplates = 0, gstartPage = 0, gpageNum = 0;
unsigned char gdataContent[32] = "";
 
void UART1_Write_Byte(unsigned char byte){
         UART1_Write(byte);
}
 
unsigned int findChecksum(unsigned char PID, unsigned int pLen, unsigned char instructionCode){
 
          return (PID + pLen + instructionCode);
}
 
void cmd_GenerateImage(const unsigned int header, unsigned long int moduleAddress, unsigned char PID, unsigned int pLen, unsigned char instructionCode);
 
 
 
//Finger Print Processing Functions
//Generate Image
void cmd_GenerateImage(const unsigned int header, unsigned long int moduleAddress, unsigned char PID, unsigned int pLen, unsigned char instructionCode){
 
    UART1_Write_Byte(Hi(header));
    UART1_Write_Byte(Lo(header));
 
    UART1_Write_Byte(Highest(moduleAddress));
    UART1_Write_Byte(Higher(moduleAddress));
    UART1_Write_Byte(Hi(moduleAddress));
    UART1_Write_Byte(Lo(moduleAddress));
 
    UART1_Write_Byte(PID);
    UART1_Write_Byte(Hi(pLen));
    UART1_Write_Byte(Lo(pLen));
 
    UART1_Write_Byte(instructionCode);
 
    UART1_Write_Byte((findChecksum(PID, pLen, instructionCode) >> 8));
    UART1_Write_Byte((findChecksum(PID, pLen, instructionCode) & 0xFF));
 
}
 
void UART1_Interrupt() iv IVT_ADDR_USART_RXC ics ICS_AUTO {
 
      if(cmd == 7){
                ackPacket[i] = UDR;
                i++;
      }
 
      if(i == 10)processAck = 1;
 
      RXC_bit = 0;
}
 
void main() {
 
     DDRB = 0xFF;
     PORTB = 0x00;
     DDRD = 0xFE;
     PORTD = 0x00;
     
     UART1_Init(57600);
     Delay_ms(2000);
     
     RXCIE_bit = 1;
 
     asm{
         sei
     }
     
     Lcd_Init();                        // Initialize LCD
     Lcd_Cmd(_LCD_CLEAR);               // Clear display
     Lcd_Cmd(_LCD_CURSOR_OFF);          // Cursor off
     Lcd_Out(1,1,"FP Scanner");                 // Write text in first row
 
 
     while(1){
     
            //Send some command to FP Scanner
            if(!processAck){
                    cmd = 7;
                    cmd_GenerateImage(gheader, gmoduleAddress, 0x01, 0x03, 0x01);
            }
            else if(processAck){
                    if(ackPacket[9] == 0x00){
                            Lcd_Out(2,1,"Finger collection   ");
                            Lcd_Out(3,1,"success             ");
                    }
                    else if(ackPacket[9] == 0x01){
                            Lcd_Out(2,1,"Error when receiving");
                            Lcd_Out(3,1,"Package             ");
                    }
                    else if(ackPacket[9] == 0x02){
                            Lcd_Out(2,1,"Can't detect finger ");
                    }
                    else if(ackPacket[9] == 0x03){
                            Lcd_Out(2,1,"Fail to collect     ");
                            Lcd_Out(3,1,"finger              ");
                    }
 
                    processAck = 0;
                    i = 0;
                    cmd = 0;
            }
 
           Delay_ms(5000);
     
     }
}


'Mikro C Pro' 카테고리의 다른 글

MikroBootloader  (0) 2015.06.19
MikroC pro for AVR 설치법  (0) 2015.06.15
CCS 와 MikroC 의 비교  (0) 2013.01.23
Making Hex  (0) 2013.01.19
Posted by ElectricShock
:
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

이어서 머리를 만들어보자

이전 챕터의 마지막 파일을 다운받아서 시작하자.

11.Chin&amp;BackHead(Result).blend

아래 영역을 선택하고 G:Grab으로 코와 코 사이를 좁혀주고,

S:Scale Down해서 코의 전체적인 크기를 줄여준다.

전체적으로 잘 다듬어준다.

우선 중간저장한 파일

1.Ear_Field.blend

Side View로 돌려서 귀 영역을 선택한다.

선택하고 Keyboard에서  E:Extrude 클릭,

마우스 LeftClick하고, S:Scale Down클릭,

사이즈를 많이 줄인다. (=Scale it way down)


그리고 Ctrl+R로 라인을 하나 더 추가한다.

Hit W to Smoothe


바깥쪽 라인을 선택후 W >> Smooth 한다.

아래 그림처럼


첫번채 Loop와 두번째 Loop영역을 선택하고 X축 방향으로 E:Extrude Out한다.


Z축 방향으로 살짝 Rotate를 해줘서 귀가 앞쪽에 향하게 만들어준다.

아래그림 참고

Extrude little one more time.


Scale Down하고 다시 Extrude In 한다.

(★Extrude Down할때 Proportional Editing을 OFF한다.)



2.Edge_of_Ear.blend

귀 앞쪽을 부드럽게 뭉개준다. (Sculpt Mode >> Smooth Tool 이용)

뒤 뒤쪽은 그냥 놔두거나 테두리만 살짝 뭉개준다.

Ctrl+R로 귀 뒤쪽에 Purpple Line을 추가한다.


귀 앞쪽을 Shift+RightClick 으로 Deselect 해준다.

(☆귓 뒤쪽만 선택한다.)

이 영역을 Scale Down하면 귓바퀴가 만들어진다.


아래 해당하는 영역을 Shift+RightClick 으로 선택하고

W >> Smooth 해서 평탄하게 만들어준다.


Tab을 눌러서 아래의 결과물 처럼 보이는지 확인한다.


여기까지 중간정리

3.Edge_of_Ear.blend

------------------------------------------------------------------------

이제 목을 만들차례이다.

C:Circle select로 목을 만들 영역을 선택한다.

E:Extrude Out Z축 방향으로

S:Scale Up along with X Axis to make Shoulder

S:Scale Up along with Y Axis to make Shoulder as well.

여기까지 중간정리

4.Neck.blend

----------------------------------------------------------------------------

Side View로 돌려서 앞쪽이 내려오고, 뒤쪽이 올라가도록 조정한다.

Ctrl+R로 라인 두개를 추가한다.

-------------------------------------------------------------------

목 중간영역을 선택하고 Alt+S누르고 Drag하면 전체적으로 Scale Down되면서

가느다란 목을 연출할 수 있다.


그리고 아래그림처럼

기존선택영역과 위쪽을선택해서 두줄을 RightClick으로 선택후

W >> Smooth 한다.


5.Narrow_Neck.blend

--------------------------------------------------------------------------

09:25

귀 영역을 선택하고 C:Circle선택으로 G:Grab해서 집어넣어준다.

(Proportional Editing은 OFF시킨다.)

Chin Area를 위로 올려줘서 Smiling Face를 만들어준다.


6.Slender_Face.blend



Posted by ElectricShock
:

BLOG main image
잡동사니들(지극히 개인취향인...) (다른글에도 댓글 부탁해요♥) You May Leave English Messages on GuestBook. by ElectricShock

공지사항

카테고리

분류 전체보기 (782)
MiDi (2)
Programming(=프로그래밍) (3)
Animation (4)
Blender (3D Graphic Program.. (10)
Blendtuts.com (Series) (1)
Blender 기초 팁들 (2)
Processing (디지털미디어과) (2)
Music (1)
Books in the world (0)
Communication(CAN, UART, et.. (12)
MCU Examples (PIC 기반) (7)
Transistor (1)
Mikro C Pro (11)
Mikro Pascal (1)
Proton IDE (0)
Robot (0)
Swift 3D (1)
Dummies Series (1)
All about Hacking (0)
제2 외국어 (1)
PIC 해외서적들 (3)
AVR (25)
PIC (MikroC) (MPLAB) (4)
Assembly (2)
ARM (3)
Arduino (26)
PSpice (1)
Proteus ISIS (14)
CodeVision (2)
FPGA (15)
MPLAB (24)
PCB (the Procedure) (15)
3D Printer (5)
PICKIT3 (6)
Matlab (11)
RaspBerry PI (15)
BeagleBone (1)
Android Studio (17)
졸업작품 (172)
Korea History (0)
Issue(사회) (73)
Multimeter 리뷰 (1)
Oscilloscope (1)
A (34)
B (19)
J (6)
C (32)
P (12)
T (37)
H (12)
I (12)
M (44)
R (5)
E (5)
F (2)
D (9)
O (2)
L (7)
S (9)
W (2)
V (6)
G (14)
Visual C++ or Visual Studio (2)
Android App Development (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백