element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum PSoC4 SPI LoRa PROBLEM
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 7 replies
  • Subscribers 460 subscribers
  • Views 1486 views
  • Users 0 members are here
  • spi interface
  • spi
  • embedded
  • microcontroller
  • psoc
Related

PSoC4 SPI LoRa PROBLEM

MKocaman
MKocaman over 2 years ago

Hello to everyone,
I'm new to PSoC and trying to learn. I have the PSoC4 CY8CKIT-041 kit. I'm struggling to run the LoRa module by communicating with SPI. The LoRa module is a module that I know well and that I run on processors such as STM32, Renesas. But I'm having trouble with PSoC, I'm stuck especially on SPI. I have attached pictures of SPI TX and RX functions and added the project separately. You can check. Can you help me for sending and receiving commands in SPI? Can you create the correct command functions for me? Thank you from now.

image

image

image

image

image

lesson1.zip

  • Sign in to reply
  • Cancel

Top Replies

  • KennyMillar
    KennyMillar over 2 years ago +2
    Hi MKocaman Wow - PSoC 4 - that takes me back a wee bit! So a few things first that I'll check with you. In the SPI_Tx function you are resetting and setting LoRa_RESET - are you shure that's right…
  • KennyMillar
    KennyMillar over 2 years ago in reply to MKocaman +2
    Can you tell me which LoRa module you are using? Do you have a link to a datasheet?
  • KennyMillar
    KennyMillar over 2 years ago +1
    Hi MKocaman So in your function Modul_Reset() in LoRa.c you set the reset and NSS pins high, then delay, then set the RESET pin low again. This leaves the NSS pin high. I don;t see it being referenced…
  • KennyMillar
    KennyMillar over 2 years ago

    Hi MKocaman 

    Wow - PSoC 4 - that takes me back a wee bit!

    So a few things first that I'll check with you.

    In the SPI_Tx function you are resetting and setting LoRa_RESET - are you shure that's right? (I don't have the LoRa module to check with).

    Also, I see there is a pin called LoRa_NSS - are you sure you are handling that correctly? Shouldn't you be driving that low for SPI transactions?

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • KennyMillar
    KennyMillar over 2 years ago

    Hi MKocaman 

    So in your function Modul_Reset() in LoRa.c you set the reset and NSS pins high, then delay, then set the RESET pin low again.

    This leaves the NSS pin high. I don;t see it being referenced anywhere else.

    Presuming that RESET is 'active high' then you should be toggling NSS before/after the SPI transactions, not RESET

    I hope this makes sense.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • MKocaman
    MKocaman over 2 years ago in reply to KennyMillar

    Oww you are right, in the parts you mentioned LoRa_NSS_Write(1); and LoRa_NSS_Write(0); will be. I made a wrong copy while in a hurry. Thank you for alerting me. But after correcting the relevant parts, nothing changes.

    My main problem is that I cannot do the SPI receiver and transmitter commands correctly in PSoC.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • MKocaman
    MKocaman over 2 years ago in reply to KennyMillar

    KennyMillar I will be very pleased if you can help me on this matter.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • KennyMillar
    KennyMillar over 2 years ago in reply to MKocaman

    Can you tell me which LoRa module you are using? Do you have a link to a datasheet?

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Cancel
  • MKocaman
    MKocaman over 2 years ago in reply to KennyMillar

    I am using RFM95W. But this is not so important. Because I have already run and use this module on other platforms. There is nothing wrong with the LORA commands either. Only I can't communicate with LORA over PSOC SPI. So there is probably something wrong with my SPI commands or configuration. I only need functions used in PSOC to send commands and read data.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • shabaz
    shabaz over 2 years ago in reply to MKocaman

    Are there no existing examples of SPI for this old processor, that could be copied? Or can you stick a logic analyzer at least, on the lines, to see if they are doing what you expect?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube