Can i write directly the port

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi

   

Can I write data directly to the por? For example, can I write an 8-bit value directly to port 4? I want to write data directly to the port without using the Control Register.

   

I need to do the writing process very quickly.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

No problem: just define a pin component(named "MyPort") with 8 pins. assign MyPort[7:0] to your required port.

   

Now a MyPort_Write(0b10101010) will write the pattern to the port.

   

 

   

Bob

View solution in original post

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

No problem: just define a pin component(named "MyPort") with 8 pins. assign MyPort[7:0] to your required port.

   

Now a MyPort_Write(0b10101010) will write the pattern to the port.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob

   

Yeah, I did it the way you said. I created a port named HUB75 using Port 4 [7: 0]. I am writing 8-bit data to this port.

   

This is my code

   

    for(i=0;i<32;i++)
    {
       HUB75_Write(pdata);
       CLK_Write(1);CLK_Write(0);
    }

   

These operations take 24us for 64Mhz cpu frequency. I can not increase the CPU frequency any more (for cy8c5868axi, max 68Mhz) Max data size 32. Can I use DMA to speed up this process?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

Furthermore: What are you exactly intending to perform? What kind of hardware is connected to that port?

   

 

   

Bob

0 Likes