5229 views|6 replies

419

Posts

1

Resources
The OP
 

AutoChips AC7801x motor demo board review (Part 2): Development environment setup + lighting [Copy link]

 This post was last edited by my student number on 2020-11-14 16:54

The previous post completed the introduction of hardware. This post records how to build a development environment and burn a lighting code.

Mainly refer to the posts on the next forum and Jiefa's document "AC7801x Development Board Instructions Manual"

The following is described in the "AC7801x Development Board Manual":

For forum friends, there is no need to explain how to install and harmonize KEIL. Here you need to download the chip support package AutoChips.AC780x_DFP.1.0.2 from the official website of Jiefa. After downloading, double-click to open it, and the system will install it to the KEIL directory.

In KEIL, select "Project"->"open project" to run the module demo provided by Jiefa; however, those demos are equipped with another set of hardware, so I decided to build a project from scratch.

First open KEIL, select "Project"->"New uVision Project" in the menu bar, select the project path, and enter the project name

Select the target chip AC78013FDLA in the device options that appear

Check the files you want to add to the project

Click "option for target" in the upper right corner to set parameters

The chip crystal frequency is selected as 8Mhz

Output, check "Generate HEX file"

In the INCLUDE PATH of the C/C++ option, enter the following path:

At this step, let's first introduce how to download the program. This motor board has a reserved JTAG interface and also supports four-wire SWD. You can use the ST-LINK on the ST NUCLEO board to download the program. The wiring method is as follows:

Remove the two jumper caps on the NUCLEO CN2 socket, and use Dupont wires or other devices to connect PIN2 (SWCLK), PIN3 (GND), and PIN4 (SWDIO) of CN4 on the NUCLEO board to PIN9 (JTCK_SWCLK), PIN8 (GND), and PIN7 (JTMS_SWDIO) of J1 on the motor board.

Connect NUCLEO to PC via USB cable. After powering on the motor board, select ST-Link Debugger in "Debug" in "option for target".

Click setting on the right. If the connection is normal, the information of the target chip will be displayed.

In "Utilities", uncheck "Use Debug Driver" and select ST-LINK in the drop-down menu of "Use Target Driver for Flash Programing".

Click on the setting on the right, check the box before "Reset and Run", so that the chip can run automatically after each download without waiting for the reset operation

At this point, the development environment is complete. Here is a simple lighting

First, add the main.c file to the project and add the following code:

#include "ac780x.h"
#include "ac780x_gpio.h"

int main(void )
{
	SystemInit();  //CLOCK Setting 
	InitDelay();  //Initilize Parameter used in function mdelay() and udelay()  
	
	GPIO_SetFunc(GPIOA, GPIO_PIN6, GPIO_FUN0);  //set GPIO as common GPIO
	GPIO_SetDir(GPIOA, GPIO_PIN6, GPIO_OUT);   //set OUTPUT direction
	
	GPIO_SetFunc(GPIOB, GPIO_PIN3, GPIO_FUN0); //set GPIO as common GPIO
	GPIO_SetDir(GPIOB, GPIO_PIN3, GPIO_OUT); //set OUTPUT direction
	
	while(1)
	{
		GPIO_SetPinLevel(GPIOA, GPIO_PIN6, GPIO_LEVEL_HIGH); //OUTPUT HIGH LEVEL
		GPIO_SetPinLevel(GPIOB, GPIO_PIN3, GPIO_LEVEL_LOW); //OUTPUT LOW LEVEL
		
		mdelay(1000);  //DELAY 1s

		GPIO_SetPinLevel(GPIOA, GPIO_PIN6, GPIO_LEVEL_LOW); //OUTPUT HIGH LEVEL
		GPIO_SetPinLevel(GPIOB, GPIO_PIN3, GPIO_LEVEL_HIGH); //OUTPUT LOW LEVEL

		mdelay(1000); //DELAY 1S
	}
}

After the compilation is correct, it can be downloaded into the chip

For contrast, an LED light was flashed on the hand.

The effect is as follows:


This post is from Domestic Chip Exchange

Latest reply

Hello, is your Jiefa development board still available? My graduation project is to use Jiefa Technology's AC7801x development board, but I can't find Jiefa's board on Taobao and other platforms, so I want to ask if your board is available for sale?   Details Published on 2022-3-28 14:15
Personal signature君应有语,渺万里层云,千山暮雪,知向谁边?
 
 

1942

Posts

2

Resources
2
 

Thanks for sharing. Are you using STLink of STM32?

This post is from Domestic Chip Exchange
 
 
 

7422

Posts

2

Resources
3
 

STLink... Turns out it is compatible with ST.

This post is from Domestic Chip Exchange
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 
 

419

Posts

1

Resources
4
 
w494143467 posted on 2020-11-14 21:19 Thanks for sharing. Are you using STLink of STM32?

According to the official documentation, this chip supports JLINK ULINK and its own ATC-LINK

This post is from Domestic Chip Exchange
Personal signature君应有语,渺万里层云,千山暮雪,知向谁边?
 
 
 

1942

Posts

2

Resources
5
 
My student number was posted on 2020-11-15 18:21 According to the official document, this chip supports JLINK ULINK and its own ATC-LINK

So what you took over from the STM32 development board should be STLink, right?

This post is from Domestic Chip Exchange
 
 
 

419

Posts

1

Resources
6
 
w494143467 Published on 2020-11-15 21:55 Then the one you took over from the STM32 development board should be STLink, right?

Yes

This post is from Domestic Chip Exchange
Personal signature君应有语,渺万里层云,千山暮雪,知向谁边?
 
 
 

2

Posts

0

Resources
7
 

Hello, is your Jiefa development board still available? My graduation project is to use Jiefa Technology's AC7801x development board, but I can't find Jiefa's board on Taobao and other platforms, so I want to ask if your board is available for sale?

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list