where i can see pin map of stm32f4 discovery?

prustprivate
Wed Apr 06, 2016 9:18 am
hi sorry for my dummy question, i have sample code from pito about C64 Emulator run correctly

// C64 Emulator, works with pic32MX and pic32MZ (SDZL board) under UECIDE
// Pito’s version, July 2014
// Works with STM32F407 Discovery, under STM32duino
// Pito March 2016

but i can’t see the serial output, i tried open pin usart map in discovery_f4.h
#define BOARD_USART1_TX_PIN Port2Pin(‘A’, 9)
#define BOARD_USART1_RX_PIN Port2Pin(‘A’,10)
#define BOARD_USART2_TX_PIN Port2Pin(‘A’, 2)
#define BOARD_USART2_RX_PIN Port2Pin(‘A’, 3)
#define BOARD_USART3_TX_PIN Port2Pin(‘D’, 8)
#define BOARD_USART3_RX_PIN Port2Pin(‘D’, 9)
#define BOARD_UART4_TX_PIN Port2Pin(‘C’,10)
#define BOARD_UART4_RX_PIN Port2Pin(‘C’,11)
#define BOARD_UART5_TX_PIN Port2Pin(‘C’,12)
#define BOARD_UART5_RX_PIN Port2Pin(‘D’, 2)

i tried in those pin , but not result i get in my serial, anyone have suggestion? or have done about that problem too?
and also this stm32f4 discovery supported pwm write already?
thnnk


Pito
Wed Apr 06, 2016 12:48 pm
I think it is the UART2, set to 921600baud 8N1 within the source..
void setup () {
Serial1.begin (921600);

prustprivate
Wed Apr 06, 2016 2:07 pm
like before, i got the used the usart 2, but i get a not recognized data, so i build a simple usart serial send data using :

void setup() {
// put your setup code here, to run once:
Serial1.begin (921600);
}

void loop() {
// put your main code here, to run repeatedly:

Serial1.println(“hello world”);
}

but i get in terminal :

èìò÷olèdr÷ïlhdr÷ïlhärw leäòï ïìhlï ìedlo ìldìo olèìo÷olhìr÷ïìhärwïìåärwïleäòwoìedòooìedlo ìeèdò÷ìlhìï ïlhìïwlìhlrwïìhäòwoìeäòw ìedò÷ ìedro ìåhìo ìlhrï

i change to Serial1.write(“hello world”); but also i got same result,
inything i do wrong guys?


stevech
Wed Apr 06, 2016 7:12 pm
prustprivate wrote:like before, i got the used the usart 2, but i get a not recognized data, so i build a simple usart serial send data using :

Serial1.begin (921600);


prustprivate
Wed Apr 06, 2016 7:21 pm
im sorry i typo for the baudrate i set 9600

Pito
Wed Apr 06, 2016 7:54 pm
Yes, the max uart speed depends on your usb/serial dongle capabilities. Some work up to 115k2 only (those without a crystal), some up to a few megabits/sec. Also the list of available baudrates differs with various dongles. The 921k6 has been used with PL2303TA one. You may set any speed your usb/serial interface does support, the higher speed, the better.
In the C64 example we simulate “C64 video screen” on a VT100 terminal, so you transmit content of the emulator’s video buffer via serial to a terminal (ie the TeraTerm). Thus you need a fast tx out of the F4 (and almost no need for a fifo). The rx into F4 comes from your “keyboard”, I can hardly imagine you can overrun the rx fifo (if any) by typing in..
p.

RogerClark
Wed Apr 06, 2016 8:53 pm
If you send 11 chars, (Hello World), but receive far more chars.

It normally indicates that your receiving device is configured to a much higher baud rate than your transmitting device.

try increasing the transmission baud rate to 38400 or higher and see what you get at the other end.

I have not tried hardware serial on the F4, so I cant absolutely confirm whether it works or not.


martinayotte
Wed Apr 06, 2016 8:57 pm
RogerClark wrote:I have not tried hardware serial on the F4, so I cant absolutely confirm whether it works or not.

stevech
Wed Apr 06, 2016 9:30 pm
Yes, but the question is code that uses 900Kbps and up. Usually needs DMA or a 16 deep UART FIFO and an ISR that USES the FIFO.

RogerClark
Wed Apr 06, 2016 10:45 pm
Steve

The OP made a correction

Their baud rate is just 9600 not nearly 1M


zmemw16
Wed Apr 06, 2016 11:05 pm
typo’s are the bane of a programmers life!
srp

prustprivate
Thu Apr 07, 2016 3:22 am
thanks for your replays guys,thats is my fault confused on pin map, and now its working, at least i tried in some several serial noted in pin map
this is the result:

serial =usart 1 port A9,A10 = error(output not recognized)
serial 1=usart 2 port c6,c7 = ok
serial 2=usart 3 port d86,d9 = ok
serial 3=usart 4 port c10,c11 = ok
serial 4=uart 5 port c12,d2 = ok

thanks


stevech
Thu Apr 07, 2016 4:46 am
RogerClark wrote:Steve

The OP made a correction

Their baud rate is just 9600 not nearly 1M


stevech
Thu Apr 07, 2016 4:47 am
zmemw16 wrote:typo’s are the bane of a programmers life!
srp

Pito
Sat Apr 09, 2016 11:12 am
I’ve got another few pl2303ta usb/serial dongles, so I’ve tried again.
STM32F4Discovery kit.
Serial1 on PA2 and PA3 (the marking on the pcb). Serial1 set to 921600.
The source as in my C64 emulator topic.
Works fine – terminal is the TeraTerm under win7, size set to 40×25 (C64 screen).
C64 screen.JPG

Leave a Reply

Your email address will not be published. Required fields are marked *