Antichambre

dipCoreF4 and dipBoardF4, a compact Core.

31 posts in this topic

1 hour ago, Phatline said:

> on DipCore PC6+PC7 you handle as LED (DOUT) - how to call them in MIOS? > as Board LEDS? aka "MIOS32_BOARD_LED_Set(0,1);" ) > see http://www.midibox.org/mios32/manual/group___m_i_o_s32___b_o_a_r_d.html#ga46e21f1170f1876435f40d65977c6a83

Yes it is! The 2 lsb bits

/////////////////////////////////////////////////////////////////////////////
//! Sets one or more LEDs to the given value(s)
//! \param[in] leds mask contains a flag for each LED which should be changed
//! \param[in] value contains the value which should be set
//! \return 0 if initialisation passed
//! \return -1 if no LEDs specified for board
//! \return -2 if one or more LEDs not available on board
/////////////////////////////////////////////////////////////////////////////
s32 MIOS32_BOARD_LED_Set(u32 leds, u32 value)
{
#if defined(MIOS32_BOARD_STM32F4DISCOVERY) || defined(MIOS32_BOARD_MBHP_CORE_STM32F4)
#if MIOS32_BOARD_J15_LED_NUM >= 1
  if( leds & 1 ) { // LED4 (Green)
    MIOS32_SYS_STM_PINSET(GPIOD, GPIO_Pin_12, value & 1);
  }
#endif
#if MIOS32_BOARD_J15_LED_NUM >= 2
  if( leds & 2 ) { // LED3 (Orange)
    MIOS32_SYS_STM_PINSET(GPIOD, GPIO_Pin_13, value & 2);
  }
#endif
#if MIOS32_BOARD_J15_LED_NUM >= 3
  if( leds & 4 ) { // LED5 (Red)
    MIOS32_SYS_STM_PINSET(GPIOD, GPIO_Pin_14, value & 4);
  }
#endif
#if MIOS32_BOARD_J15_LED_NUM >= 4
  if( leds & 8 ) { // LED6 (Blue)
    MIOS32_SYS_STM_PINSET(GPIOD, GPIO_Pin_15, value & 8);
  }
#endif

  if( leds & 0xfffffff0)
    return -2; // LED doesn't exist

  return 0; // no error
#elif defined(MIOS32_BOARD_DIPCOREF4)
#if MIOS32_BOARD_J15_LED_NUM >= 1
  if( leds & 1 ) { // LED0 (Green)
    MIOS32_SYS_STM_PINSET(GPIOC, GPIO_Pin_6, value & 1);
  }
#endif
#if MIOS32_BOARD_J15_LED_NUM >= 2
  if( leds & 2 ) { // LED1 (Orange)
    MIOS32_SYS_STM_PINSET(GPIOC, GPIO_Pin_7, value & 2);
  }
#endif
  if( leds & 0xfffffffc)
    return -2; // LED doesn't exist
  
  return 0; // no error
#else
  return -1; // no LED specified for board
#endif
}

 

 

 

1 hour ago, Phatline said:

> the PTC you used on DipCore what SMD Package is it? ( i want take the same as on DipCore... dont want to buy 2 different parts)

1206 package

PTC_1206L_series_SPL.jpghttps://www.mouser.fr/ProductDetail/576-1206L150THWR

1 hour ago, Phatline said:

> since i will be ready soon with the cc_looper - will order Protoboards for it the next days - i assume nothing changed on the Pinout of the DipCore until now > so i can order?

No, dipCoreF4 pinout will not change... I'm working on something which will maybe change STM pin assignation. but dip-40(48) will keep the same pinout and function.
Try to do not put any component in the dip40 area. It is possible that I add some feature and pin, somewhere in the alignment of 41-43 or 44-48.

Best
Bruno

Edited by Antichambre

Share this post


Link to post
Share on other sites
18 hours ago, Phatline said:

> since i will be ready soon with the cc_looper - will order Protoboards for it the next days - i assume nothing changed on the Pinout of the DipCore until now > so i can order?

17 hours ago, Antichambre said:

No, dipCoreF4 pinout will not change... I'm working on something which will maybe change STM pin assignation. but dip-40(48) will keep the same pinout and function.

Hi,

After some try, I'm able to use the second USB OTG, the USB_OTG_HS in full speed with the embedded FS phy.

The idea is to keep the USB_OTG_FS as it is in dual role with ID pin. And add the USB_OTG_HS in FS Host Only, to connect a B-device only.

It works fine for HID(Keyboard and Mouse), I will complete the classes with MSC(Mass Storage), maybe MIDI.

Here, MIOS Studio is connected in USB(normal one) and I plug a mouse first then a keyboard to the other USB:
( did this test with a modified wCore)
Capture%20d%E2%80%99%C3%A9cran%202018-09
This is very difficult too implement on a mbhp disco or wCore cause the DP/DM pins are used for J8/9 SI/SO(PB14/PB15). BUT! I can do it on the dipCoreF4, by moving SI/SO on other alternate function pins.

=> Then like I said I will make some changes on the STM32F405 pins and on MIOS32 side. Add pins for DP/DM and Over-current/VBUS Drive GPIO of the second USB on the dip40(other extra pins).

Host%20Only.png?raw=1

And modify the dipBoardF4 for that purpose of course.

Have a good WE
Best Bruno

 

 

Edited by Antichambre
1 person likes this

Share this post


Link to post
Share on other sites

hey

i am working on a new project "Konga Trigga", and i want to reuse the DipCoreF4 for that again... since it is really handy :cheers:

i need 3 Digital Inputs (used as Trigger inputs  -  feedet with Schmitt-Trigger Digital Signals)

 

i dont want to connect them via a slow shift register - since it is trigger > it is time critical.

As far as i can see i can use J5.A0(PA1)  +  J5 A1(PC5) > and set them in Mios as Digital Input, makes 2

so only one Digital input left - is there any other Pin i can use as DIN? (LED.1, LED.0 for example?)

 

User.Butt (PA0) > is for Bootloader Switch  - maybe that one?

Share this post


Link to post
Share on other sites

Hi Phatline,

You can use the pin you want, all pins are GPIO as first function.
Just don't take something already used(SDcard, midi, etc..). You want input then don't use 5V level output pin(SC, SO, RC) like the one of J19 or J8/9, they can not be input. But you can use J4 for example.

Best regards
Bruno

1 person likes this

Share this post


Link to post
Share on other sites

thx!

so

PB6-J4A.SD

PB7-J4B.SD

for example?

fine

do i have to change anything in mios itself - or is it done in the main app/mios.config file? (i know J5 and J10 are GPIO labeled on standard core docu - but J4 is for IIC)

Edited by Phatline

Share this post


Link to post
Share on other sites

In mios32_config file add :

#define MIOS32_DONT_USE_IIC

and the pin of J4 will not be initialized as I2C.

Then initialize the pin as Input e.g. PB6

  GPIO_InitTypeDef GPIO_InitStructure;
  GPIO_StructInit(&GPIO_InitStructure);
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  GPIO_Init(GPIOB, &GPIO_InitStructure);

Finally to get value:

u8 value = (u8)MIOS32_SYS_STM_PINGET(GPIOB, GPIO_Pin_6);

Best
Bruno

 

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now