2013-06-02 04:34 AM
hello :)
i had a problem when i send a character or receive a character , i always get a wrong character like ''-'' or a heart ... ps: i'm using rs232 -> USB converter here is my code: &sharpinclude ''stm32f4xx.h'' void main() { //UART4 initialization RCC->APB1ENR |= 0x00080000; // Enable clock for UART4 RCC->AHB1ENR |= 0x00000004; // Enable clock for GPIOC GPIOC->MODER |= 0x00a00000; // PC10, PC11 => AF mode GPIOC->AFR[1] |= 0x00008800; // select AF8 (UART4,5,6) for PA10, PA11 UART4->BRR = 0x1120; // 9600 baud UART4->CR1 |= 0x200c; // Enable UART for TX, RX UART4->CR1 |= 0x0020; // Enable RX interrupt while(1){ if (UART4->SR & 0x0080) { UART4->DR='a'; for (int i=0; i<10000000; i++) {}; } } } please any help! :( #too-vague2013-06-04 12:24 PM
That does put you in a bit of a pickle.
Also be conscious that the STM32 outputs CMOS levels, not RS232 compatible levels. You want to be using a USB-to-CMOS Serial type device where the STM32 connects directly to a chip from FTDI, Prolific or SiLabs. For RS232 interfacing a MAX3232 type level converter will be required.2013-06-04 03:08 PM
but even i'm using usb -> rs232 converter ? because many said to me that i dont need max232 or other to make it works
2013-06-04 05:09 PM
but even i'm using usb -> rs232 converter ? because many said to me that i dont need max232 or other to make it works
Well let's be careful here, using a USB-to-RS232 *IS* going to require a MAX232/3232 type device. To be avoiding that you need something different. Like this DLP-TXRX type device.http://www.dlpdesign.com/usb/txrx.shtml
Maybe you can cite specifically what you are attempting to interface with, ideally with a part# and web link.2013-06-08 01:49 AM
thank you , i will put an extra effort to resolve this problem then i will feed back my results
2013-06-08 03:07 AM
Clive can u attach your system_stm32f4xx.c file for stm32f4 dsicovery? and thnak you
2013-06-08 04:10 AM
This is the one in STM32F4-Discovery_FW_V1.1.0\Project\Demonstration\
/public/STe2ecommunities/mcu/Lists/STM32Discovery/Attachments/6370/system_stm32f4xx.c
________________ Attachments : system_stm32f4xx.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hznd&d=%2Fa%2F0X0000000bPm%2FXiYcXZgm_U2et6i.lOrwQh2MuT2vGiuhzoQztIrwoxs&asPdf=false2013-06-10 01:26 PM
thank you so much , probably i have problem in 3.3 v -> 5v conversion (i use usb cable for rs232) so i have to make a circuit to do that conversion or buy a TI component to do this job
2013-06-10 01:58 PM
i use usb cable for rs232
Does it have a part number or web site?2013-06-11 02:59 AM
it's this reference http://pdf.datasheetcatalog.net/datasheet/maxim/MAX3233E-MAX3235E.pdf
it has an internal capacitors2013-06-11 05:35 AM
I was asking about the USB-to-RS232/Serial cable that you are using.