Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[ARM] stm32f3, writebit, but no signal out. why?

Status
Not open for further replies.

matise

Newbie level 4
Joined
Nov 15, 2012
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,321
I need to send a series of bits, one at at time throu GPIOc port c6-c9.
I will show you the part of code that is intresting here.

I will use this ports:
PC9 - W_CLK
PC8 - FQ_UD
PC7 - DATA
PC6 - RESET

I use push pull and speed 2 MHz.
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;

And this is the bits i will send throu PortC7 from right to left:
char frequency = 0x0A3D70A4; // 5MHz

Here is part of the code for sending data out PC7:


Code dot - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
for (n=0; n<32; n++)
    {
               frequency & 0x1 == 1;
        
        if ((frequency & 0x1) == 1)                                      // set data pin (2) to 1 or 0
        {
            GPIO_WriteBit(GPIOC, GPIO_Pin_7, Bit_SET);       // set data pin (2) to 1
        }
        else
        {
             GPIO_WriteBit(GPIOC, GPIO_Pin_7, Bit_RESET);    // set data pin (2) to 0
        }



And later:

frequency>>=1; // shift one bit...

A simple code but there is no signal out.
Nothing comes out from port C7.

So what is it i do wrong here?
What is it i dont understand?
Do i need some other Mode out?
Or maybe i cant use WriteBit this way?

Someone have a clue about this? :)
 
Last edited by a moderator:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top