This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

C51 memcpy from SFR's

Good morning

Is there a way to memcpy from SFR's in the C51?

I have tried to memcpy((char*)&buffer, (char*)&CAN0IF2DA1L, 8); but it doesn't work

Other things i tried

memcpy((char*)&buffer,  CAN0IF2DA1L, 8);                                     //error C214: illegal pointer conversion

memcpy((char*)&buffer, (char*)&CAN0IF2DA1L, 8);                         //error C189: '&' on bit/sfr illegal

Any ideas?

Richard

Parents
  • I am aware of the different address spaces but do not know how to create a pointer to the SFR address space

    That statement is self-contradictory.  Just about the single most important thing to learn about the different address spaces of an 8051 is that one cannot create a pointer to an SFR.

Reply
  • I am aware of the different address spaces but do not know how to create a pointer to the SFR address space

    That statement is self-contradictory.  Just about the single most important thing to learn about the different address spaces of an 8051 is that one cannot create a pointer to an SFR.

Children
No data