코딩/FPGA(11)
-
[FPGA] 세탁기 프로젝트
AVR-FPGA 를 이용하여 세탁기 모형 제작 FPGA 블록도 상태천이도 MAIN.c #define F_CPU 16000000UL #include #include #include #include "button.h" #include "buzzer.h" #include "lcd_4bit.h" #include "mode.h" int main(void) { pwmInit(); char buff[30]; LCD_Init(); int count = 0; modeState = mainmenu; while (1) { select_mode(); } } LCD_4bit.c #include "lcd_4bit.h" uint8_t lcdData = 0; void slaveSelect(uint8_t state) { if (sta..
2021.11.30 -
[FPGA]FPGA 보드에 CPU 코어 만들기 MicroBlaze 사용
블록 디자인을 만든 다음에 MicroBlaze를 불러온다 불러온 MB우클릭 또는 상단 녹색바의 Run Block Automation을 누른다 나는 아직 배우는 입장이라 용량을 넉넉 하게 128KB로 잡고 인터럽트는 사용을 안할것이기 때문에 체크박스는 가만히 둔채로 OK 버튼을 누른다 OK를 누르면 이러한 블록들이 나타날 것이다 이때 CLK을 더블클릭한다 sysclk 를 사용할것이기 때문에 커스텀 에서 sys clock로 바꿔준다. GPIO, uart도 사용할 것이기 때문에 추가를 한다. 추가를 한뒤 상단의 Run Connection Automation을 선택한다 그러면 연결이 가능한 리스트가 뜨는데 그 리스트 들의 체크박스를 전부 체크한뒤에 ok를 누른다 연결이 다 됬으면 Create HDL Wrappe..
2021.11.17 -
[FPGA] FPGA+ AVR Buzzer + Motor
main.c #define F_CPU 16000000UL #include #include #include #include "button.h" #define PWM_ADDR_DDRDDRD #define PWM_ADDR_PORTPORTD #define PWM_DATA_DDRDDRF #define PWM_DATA_PORTPORTF #define PWM_CLK_DDRDDRD #define PWM_EN_DDRDDRD #define PWM_CS_DDRDDRD #define PWM_CLK_PORTPORTD #define PWM_EN_PORTPORTD #define PWM_CS_PORTPORTD #define sw0_PORTPORTD #define sw0_DDRDDRD #define sw1_PORTPORTD #defi..
2021.11.12 -
[FPGA] FPGA + AVR StopWatch
#define F_CPU16000000UL #include #include #include #include "button.h" // fnd select PD0,PD1 // fnd bin PD2 ~ PD5 #define FND_SELECT_DDRDDRD #define FND_BIN_DDRDDRD #define FND_SELECT_PORTPORTD #define FND_BIN_PORTPORTD #define FND_PORTPORTD uint8_t fndDigit1Data; uint8_t fndDigit2Data; uint8_t fndDigit3Data; uint8_t fndDigit4Data; volatile uint16_t fndCounter = 0; uint8_t state; enum {STOP, RUN..
2021.11.12 -
FPGA IP PACKAGE 하는 방법
1.Tools -> Crreate and Package New IP... 2. Next 선택 3.위쪽메뉴를 선택한뒤 Next 4.경로 설정후 Next 5. Finish 6. DIsplay name과 Ports and Interfaces 에서 in,out Port 체크 7.Package IP하면 완성 Package 한 IP를 불러오는 방법 1.create Block Design 을 누른뒤 디자인 이름을 설정하고 ok를 누른다 2.Settings 에 들어가서 IP란의 Repository 를 선택한뒤 + 를 누른다 3.IP를 모아둔 폴더를 선택한뒤 OK버튼을 눌러 창을 닫는다 4. +를 눌르면 IP를 찾을수 있는 창이 뜨는데 여기에 나한테 필요한 등록해둔 IP를 검색,선택하여 불러온다 5. 찾은 IP Diag..
2021.11.12 -
[FPGA] Stopwatch + Clock + LED bar
TOP module top_timeWatch( input sysclk, input i_rst_n, input i_mode, output o_muxOut_2, output [3:0] o_fndSelect, output [7:0] o_fndFont ); wire w_sec_ind; TimeClock timer( .sysclk(sysclk), .i_rst_n(i_rst_n), .o_sec_ind(w_sec_ind), .o_timeData(w_timeData) ); wire [13:0] w_timeData; wire w_upc_ind; upCounter upcount( .sysclk(sysclk), .i_rst_n(i_rst_n), .o_upc_ind(w_upc_ind), .o_upCounter(w_upcoun..
2021.11.10