writing data on external eeprom via psoc

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 i am  transfering data from hyperterminal to psoc and writing it  on external eeprom but not working attaching the code. pls suggest.

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

Do not forget that every write to the SPIM causes a byte to be sent back that you have to read off. It seems that the logic depending on the bytes read from SPI do not reflect that.

   

Keep in mind that the SPIM has got 2 FIFO buffers, so there is no need to wait for the transmission is done except you want the ss-signal to toggle. Writes to SPIM are blocking until there is room in the buffer.

   

Some other points I would suggest you to change:

   

Do not define loop variables as global (outside main() ) this may lead to an error easily.

   

The interrupt handler within isr_2 is clobbered, one of the special comments has been deleted by accident

   

The interrupt routine in isr_uart is fairly long and contains delays. This is something you should strongly avoid. Interrupt handlers work bet when they just remove the interrupt cause and set a flag on which the main-loop reacts on.

   

There is a different (safer) way to write interrupt handlers that avoids changes in the generated files which can be overwritten accidently, have a look (search) for CY_ISR and CY_ISR_PROTO in the "System Reference Guide" to be found from Creator's Help.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Generally speaking variables used in ISR routines should

   

be declared as volatile.

   

 

   

    

   

          http://www.barrgroup.com/Embedded-Systems/How-To/C-Volatile-Keyword

   

 

   

Regards, Dana.

0 Likes