Jump to content
    

CH32V003 OPA

Коллеги, использовал ли кто-нибудь встроенный OPA в CH32V003?

Я попробовал включить его по схеме неинвертирующего усилителя.

Настроил следующим образом:

void OPA_INIT (void)
{
	GPIO_InitTypeDef GPIO_InitStructure = {0} ;
	OPA_InitTypeDef  OPA_InitStructure = {0} ;

	RCC_APB2PeriphClockCmd (RCC_APB2Periph_GPIOD, ENABLE) ;
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7 ;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING ;

	GPIO_Init (GPIOD, &GPIO_InitStructure) ;
	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 ;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING ;
	GPIO_Init (GPIOD, &GPIO_InitStructure) ;

	GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 ;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN ;
	GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz ;
	GPIO_Init (GPIOD, &GPIO_InitStructure) ;

	OPA_InitStructure.PSEL = CHP1 ;
	OPA_InitStructure.NSEL = CHN1 ;
	OPA_Init (&OPA_InitStructure) ;
	OPA_Cmd (ENABLE) ;
}

ОС 10к/43к, КУ = 5.3.

Для входного напряжения 0.5В на выходе должно быть 2.65В, а по факту там 0 или VCC в зависимости от входного напряжения.

Как будто это не усилитель, а компаратор...

Хотя в datasheet написано именно OPA.

Share this post


Link to post
Share on other sites

UPD.

Если перенастроить на OPP0/OPN0, то все работает...

Походу какой-то баг в самом чипе...

Share this post


Link to post
Share on other sites

А функция NRST на PD7 при этом отключалась?

Цитата

Note: When using PD7, the reset function of this pin needs to be turned off.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...