Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM8 #35

Closed
pdbayes opened this issue Jan 26, 2023 · 28 comments
Closed

STM8 #35

pdbayes opened this issue Jan 26, 2023 · 28 comments

Comments

@pdbayes
Copy link

pdbayes commented Jan 26, 2023

Hi
I have the Ebyte E07 dev board with uart. The processor is an stm8, does anyone know how to port this code for an STM8?

@ghoti57
Copy link
Owner

ghoti57 commented Jan 26, 2023

Good luck with that :-)

The code has a lot of atmega specific code for the hardware interface.
Because of the overhead the code doesn't use the Arduino IO functions but drives the GPIO pins directly via the registers.

TX uses the SPI interface to fill the cc1101 TX fifo, but, because of the jitter on the incoming signals from the other devices, you can't use the cc1101 rx fifo to capture the data because it assumes everything is synchronous.

If you try a port then I suggest you get the SPI interface to the CC1101 working first and then the HW UART interface between the STM and the CC1101. This is just an ISR triggered by the UART that reads the UART RX data into a buffer.

If the STM hasn't got a HW UART available then you'll need to be good at coding. I suspect the STM8 HW UART has been connected to the host USB interface so this is going to be the case.

The atmega328p SW UART code uses a HW interrupt to capture the timing of the signal edges and then a SW trap to process the captured data edges to generate an RX byte. This is very processor heavy and every cycle is critical to keep up with the data when it arrives. The SW UART won't work on an atmega clocked at less than 16MHz because there aren't enough instruction cycles available.

The SW UART code is not as good at RXing radio messages as the HW UART code.

Using a simple USB logic analyser ( e.g. https://www.amazon.co.uk/Hobby-Components-24MHz-Analyser-1-1-16/dp/B00DAYAREW) there are some debug lines still in the code that you can use to drive spare GPIO pins that will show you how much processor time you're using in the HW and SW ISR functions.

The frame, message and host interface code should work without significant changes.

That's all the help I can offer since I have zero STM knowledge.

If you don't understand what I've said above give up now.

@pdbayes
Copy link
Author

pdbayes commented Jan 26, 2023 via email

@ghoti57
Copy link
Owner

ghoti57 commented Jan 26, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Jan 26, 2023 via email

@ghoti57
Copy link
Owner

ghoti57 commented Jan 26, 2023 via email

@ghoti57
Copy link
Owner

ghoti57 commented Jan 26, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Jan 27, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Jan 28, 2023 via email

@ghoti57
Copy link
Owner

ghoti57 commented Jan 28, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Jan 28, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Jan 29, 2023 via email

@ghoti57
Copy link
Owner

ghoti57 commented Jan 29, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Jan 29, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Jan 31, 2023 via email

@ghoti57
Copy link
Owner

ghoti57 commented Jan 31, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Jan 31, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Feb 1, 2023 via email

@ghoti57
Copy link
Owner

ghoti57 commented Feb 1, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Feb 1, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Feb 5, 2023 via email

@ghoti57
Copy link
Owner

ghoti57 commented Feb 5, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Feb 5, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Feb 5, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Feb 13, 2023

Hi. The device I got worked perfectly. You do need a reasonably good soldering station and good eyesight, magnifier. I used to rework SMD chips for a living but my eyesight is not what it used to be, but managed to do it. Thanks for all your help. I can recommend the kit I ordered as the service was good and they sent a booklet on assembly and preloaded the firmware. I would advise anyone avoid eBay sellers claiming to cover all frequency bands. I had to explain the regulations, technicalities etc to the seller who insulted my knowledge and claimed he wasn't selling what turned out to be an ebyte 433mhz module but he was selling a CC1101. He couldn't understand that once in a circuit the circuit is what needs to be tested and approved. I also did RG approvals in a lab for a few years and he still wouldn't have it. Luckily eBay stepped in and refunded.

@ghoti57
Copy link
Owner

ghoti57 commented Feb 13, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Feb 13, 2023 via email

@ghoti57
Copy link
Owner

ghoti57 commented Feb 13, 2023 via email

@pdbayes
Copy link
Author

pdbayes commented Feb 13, 2023 via email

Repository owner locked and limited conversation to collaborators Feb 14, 2023
@ghoti57 ghoti57 converted this issue into discussion #37 Feb 14, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants