MiniUART
Timo Hartong (2813) 204 posts |
On the rPi there are two UARTS: |
mikko (3145) 123 posts |
Nice work, Timo! It would be great to see the code. |
Timo Hartong (2813) 204 posts |
Hi Mikko, Please find the code here. Please note it is work in heavy development. And not an example of software engineering and perfect code |
mikko (3145) 123 posts |
Perfect code only lives in textbooks, Timo! Thanks for sharing. TBH I’ve just been programming in BASIC in RISC OS but I do know a bit of C and have the NutPi DDE so this is a good opportunity for me to explore it… |
Timo Hartong (2813) 204 posts |
You are most welcome. If you find any mistakes please let me know. |
Timo Hartong (2813) 204 posts |
So and again a little progress starting on the DeviceFS side of things: |
Timo Hartong (2813) 204 posts |
More progress and quite important the receive interrupt prototype now works. That was quite looking how that worked. |
Rick Murray (539) 13851 posts |
http://www.riscos.info/packages/DevelopmentDetails.html#Cppcheck cppcheck is a bit of a pain to use (seems to like not finding stuff (filename issues?) so I check my files one by one) but it is useful for giving the code a check to find various problems that compilers aren’t designed to find (compilers check the source is correct, cppcheck checks that what the source does is correct). |
Timo Hartong (2813) 204 posts |
That is indeed a handy tool which will speed things up. |
Timo Hartong (2813) 204 posts |
Hi thanks to David I now have dedicated web space for RISCOS. Please find the source code until so far. Please note as long it is not indicated as ‘release’ it is code under development: |
Timo Hartong (2813) 204 posts |
An update on the code. You will find an improved prototype of the interrupt code. And a number of global variables have been removed and replaced by better alternatives. The code is still under development and can be found under. |
Timo Hartong (2813) 204 posts |
On 4 oktober 2018 I worked on the receive interrupt code and the device driver code: |
Timo Hartong (2813) 204 posts |
Update on the source available on the well known address ;-). In this case I worked on the validation string. So we can set the baudrate while opening the com port |
Timo Hartong (2813) 204 posts |
Hi , I bumped into a problem the receive interrupt routine only receives 9 charakters and then nope data anymore. I have no idea what is happening thereā¦. |
Jon Abbott (1421) 2651 posts |
At a guess the buffer size of the MiniUART is 8 and its overflowed? |
Timo Hartong (2813) 204 posts |
It would say that is the case and after a good(?) night sleep I also realized something else and that is something on the sending side. |
Timo Hartong (2813) 204 posts |
An update on the code ;-) It can be found all on : |
Timo Hartong (2813) 204 posts |
There was some time no update on this project. But I’m happy to tell that I can now send data successfully and no data is lost anymore. To solve this a FIFO is used to send the data. One can find the source on: |
Timo Hartong (2813) 204 posts |
I was a little bit too happy so it seems. With bigger chunks of data it didn’t went so well. It seems to be solved. Still open items in the MiniUART module: |