Remap PB2

Post here first, or if you can't find a relevant section!
tutuli
Posts: 2
Joined: Fri Feb 10, 2017 12:46 pm

Remap PB2

Post by tutuli » Fri Feb 10, 2017 12:56 pm

Hi,

im using a Maple mini clone (stm32f103) with the Arduino ide where the BOOT1 pin is wired through a 100k resistor to PB2.
For my project i need the whole 16 bits of Port B to which i am writing 16 Bit data by a DMA channel.
Is it possible to remap the output of PB2 to another gpis pin, e.g. PA15?

victor_pv
Posts: 1339
Joined: Mon Apr 27, 2015 12:12 pm

Re: Remap PB2

Post by victor_pv » Fri Feb 10, 2017 1:49 pm

No, you can only remap alternate functions.

You may want to use a different board, such as the bluepill, or some other of the generic boards if you really need to use that pin.

stevestrong
Posts: 1346
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Remap PB2

Post by stevestrong » Fri Feb 10, 2017 2:09 pm

You can use PB2 as normal GPIO. I am also using it for driving 8 bit parallel display. PB2 has only relevance at boot time, and if the connected external part is input only, then it will not disturb the boot process. Maybe an additional pull-up (or down?) resistor will do the trick, although it works for me without.
In this case you should simply shorten the 100k resistor and connect whatever you want to middle pin of BOOT1 jumper block.

tutuli
Posts: 2
Joined: Fri Feb 10, 2017 12:46 pm

Re: Remap PB2

Post by tutuli » Fri Feb 10, 2017 2:13 pm

thank you for your responses. The 100k short / boot1 pin usage approach seems reasonable.

User avatar
RogerClark
Posts: 6130
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Remap PB2

Post by RogerClark » Fri Feb 10, 2017 7:53 pm

boot1 only does anything if boot0 is pulled high.

I dont think you need to do anything about it.

You could of course just cut the track with a sharp knife. or unsolder the resistor

victor_pv
Posts: 1339
Joined: Mon Apr 27, 2015 12:12 pm

Re: Remap PB2

Post by victor_pv » Fri Feb 10, 2017 8:46 pm

RogerClark wrote:boot1 only does anything if boot0 is pulled high.

I dont think you need to do anything about it.

You could of course just cut the track with a sharp knife. or unsolder the resistor
I think Steve mentioned he can jump the resistor so use the Boot1 pin header that's somewhere in the board because in the Maple mini PB2 is not going to the long side headers.
That's why I suggested getting another board, that would have it a header, but I didn't remember it goes to another header.

User avatar
RogerClark
Posts: 6130
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Remap PB2

Post by RogerClark » Fri Feb 10, 2017 11:37 pm

@victor_pv

No worries.

These boards are as cheap as chips, so the OP may as well get another one, as long as they are willing to wait for it to arrive

User avatar
efftek
Posts: 72
Joined: Tue Jan 10, 2017 9:42 pm
Location: UK / Cyprus
Contact:

Re: Remap PB2

Post by efftek » Wed Feb 22, 2017 9:54 am

RogerClark wrote:@victor_pv

No worries.

These boards are as cheap as chips, so the OP may as well get another one, as long as they are willing to wait for it to arrive
I have several blue pills from different aliexpress/ebay sellers - NONE has PB2 so getting another board may be a waste of time (never a waste of money, you just cant have enough spare boards at 1.63 GBP - or should that be PBP, pre brexit pounds?)

@Stevestrong Im wanting to try your TFT library - found no PB2 on my board hence arrived at this page. I have bootloader installed so Boot0 is always pulled low. Does this mean I can remove Boot1 Jumper and use the middle pin for PB2? - much easire than trying to solder wire to resistor R4 on underside of boards!

Thanks for all your efforts - you guys keep numpties like me on track.

Edit: R4 is 100k as mentioned above, so again as mentioned above, needs to be shorted. Going to replace R4 with a blob of solder and test - Thats why you need spare boards!

stevestrong
Posts: 1346
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Remap PB2

Post by stevestrong » Wed Feb 22, 2017 10:42 am

@efftek, the board should work fine with R10 shorted, so you can use PB2 (mid point of BOOT1 jumper) as GPIO without any problem, as long BOOT0 is in its original position.

User avatar
efftek
Posts: 72
Joined: Tue Jan 10, 2017 9:42 pm
Location: UK / Cyprus
Contact:

Re: Remap PB2

Post by efftek » Wed Feb 22, 2017 12:20 pm

@Stevestrong

Thanks for the reply. I have now shorted R4 and wired the TFT as in the photos. However, when I try to compile the graphicstest example from your library, I get these errors

C:\Users\Steve\Documents\Arduino\libraries\Adafruit_TFTLCD_8bit_STM32-master\Adafruit_TFTLCD_8bit_STM32.cpp:489:21: error: 'readReg32' was not declared in this scope

and

C:\Users\Steve\Documents\Arduino\libraries\Adafruit_TFTLCD_8bit_STM32-master\Adafruit_TFTLCD_8bit_STM32.cpp:499:31: error: 'readReg32' was not declared in this scope

Any thoughts?

Steve.
short.jpg
short.jpg (168.95 KiB) Viewed 288 times
wiring2.jpg
wiring2.jpg (154.21 KiB) Viewed 288 times

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest