SPI Dot-Matrix
-
- Posts: 73
- Joined: Sat Dec 02, 2017 8:02 pm
- languages_spoken: english
- ODROIDs: .
8-XU4's
11-MC1's
6 - N2's - Has thanked: 10 times
- Been thanked: 1 time
- Contact:
SPI Dot-Matrix
Is the SPI Dot-Matrix https://wiki.odroid.com/accessory/displ ... rix_shield compatible with the N2 ?
Do I need to start with installing spidev on the 18.04 image?
Any help appreciated.
Do I need to start with installing spidev on the 18.04 image?
Any help appreciated.
- tobetter
- Posts: 4263
- Joined: Mon Feb 25, 2013 10:55 am
- languages_spoken: Korean, English
- ODROIDs: X, X2, U2, U3, XU3, C1
- Location: Paju, South Korea
- Has thanked: 58 times
- Been thanked: 234 times
- Contact:
Re: SPI Dot-Matrix
I think it would work if you success to enable SPI bus on ODROID-N2, here is the Wiki for it.additude wrote:Is the SPI Dot-Matrix https://wiki.odroid.com/accessory/displ ... rix_shield compatible with the N2 ?
Do I need to start with installing spidev on the 18.04 image?
Any help appreciated.
https://wiki.odroid.com/odroid-n2/appli ... _odroid-n2
Since I have not tested it yet, you would need to change the original code to give the SPI bus and channel.
"Tapatalk wishes you to have fun with ODROID"
-
- Posts: 73
- Joined: Sat Dec 02, 2017 8:02 pm
- languages_spoken: english
- ODROIDs: .
8-XU4's
11-MC1's
6 - N2's - Has thanked: 10 times
- Been thanked: 1 time
- Contact:
Re: SPI Dot-Matrix
I already have the SPI Dot Matrix working on an XU4 after making a few changes to the original code like using spidev1.0 so I am novicely kind of aware of how it works.
For the N2, I installed all the requirements except spidev in this case ended up being spidev0.0 and after getting everything installed I was able to have success running the spidev_test.c which in lieu of reporting FF FF FF FF it would also light one single LED on the array.
Now seeing as I can have a working model with spidev1.0 I'm kind of thinking this is the issue.
One other thing I noticed was that when I compiled the original code it gave errors for shift_len on the N2 but the exact same code compiled just fine on the XU4
In this case, my START_STR is 124 Characters preceded by " and trailed by ". The XU4 compiles it just fine but as you can see the N2 compains about the " " as legitimate bytes saying it should be 124 + 1 + 1 for a total of 126.
The XU4 is fine with
But the N2 needs
gcc versions for both were the same and the N2 is current 18.04 and so is the XU4 (18.04)
So that puzzels me as well...
Here is the output of gcc
So I feel that something is missing or not working correctly.
For the N2, I installed all the requirements except spidev in this case ended up being spidev0.0 and after getting everything installed I was able to have success running the spidev_test.c which in lieu of reporting FF FF FF FF it would also light one single LED on the array.
Now seeing as I can have a working model with spidev1.0 I'm kind of thinking this is the issue.
One other thing I noticed was that when I compiled the original code it gave errors for shift_len on the N2 but the exact same code compiled just fine on the XU4
In this case, my START_STR is 124 Characters preceded by " and trailed by ". The XU4 compiles it just fine but as you can see the N2 compains about the " " as legitimate bytes saying it should be 124 + 1 + 1 for a total of 126.
The XU4 is fine with
Code: Select all
#define MAX_SHIFT_CHAR_COUNT 124
Code: Select all
#define MAX_SHIFT_CHAR_COUNT 126
So that puzzels me as well...
Here is the output of gcc
Code: Select all
dot_shift_test.c: In function 'main':
dot_shift_test.c:578:47: warning: ' ' directive writing 1 byte into a region of size 0 [-Wformat-overflow=]
shift_len = sprintf(&disp_str[0], "%s ", START_STR);
^
dot_shift_test.c:578:20: note: 'sprintf' output 126 bytes into a destination of size 124
shift_len = sprintf(&disp_str[0], "%s ", START_STR);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Posts: 73
- Joined: Sat Dec 02, 2017 8:02 pm
- languages_spoken: english
- ODROIDs: .
8-XU4's
11-MC1's
6 - N2's - Has thanked: 10 times
- Been thanked: 1 time
- Contact:
Re: SPI Dot-Matrix
So I swapped out the SPI Dot Matrix that I have and I wired in an 8 x 32 (4 - 8x8 matrices in tandem) and I was able to get a scrolling display.
I guess I must have a broken SPI Dot Matrix.... I'll have to plug it into an XU4 Shifter Shield later and see if it's broke.
I'm still trying to understand why the compiler see's the " " as a byte character when those quote marks are just defining for the variable START_STR.
The displayed scroll on the matrices does not have quotes " " in the scroll and compiling the exact same code on the XU4 has no complaints.
I guess I must have a broken SPI Dot Matrix.... I'll have to plug it into an XU4 Shifter Shield later and see if it's broke.
I'm still trying to understand why the compiler see's the " " as a byte character when those quote marks are just defining for the variable START_STR.
The displayed scroll on the matrices does not have quotes " " in the scroll and compiling the exact same code on the XU4 has no complaints.
- tobetter
- Posts: 4263
- Joined: Mon Feb 25, 2013 10:55 am
- languages_spoken: Korean, English
- ODROIDs: X, X2, U2, U3, XU3, C1
- Location: Paju, South Korea
- Has thanked: 58 times
- Been thanked: 234 times
- Contact:
Re: SPI Dot-Matrix
Isn't sizeof(START_STR) is 124 and sizeof(&disp_str[0])? Then "%s ", START_STR becomes 126 bytes which exceeds 2 bytes more than sizeof(&disp_str[0]) if my understanding of your code is correct.additude wrote: ↑Sat Nov 30, 2019 8:26 pmSo I swapped out the SPI Dot Matrix that I have and I wired in an 8 x 32 (4 - 8x8 matrices in tandem) and I was able to get a scrolling display.
I guess I must have a broken SPI Dot Matrix.... I'll have to plug it into an XU4 Shifter Shield later and see if it's broke.
I'm still trying to understand why the compiler see's the " " as a byte character when those quote marks are just defining for the variable START_STR.
The displayed scroll on the matrices does not have quotes " " in the scroll and compiling the exact same code on the XU4 has no complaints.
-
- Posts: 73
- Joined: Sat Dec 02, 2017 8:02 pm
- languages_spoken: english
- ODROIDs: .
8-XU4's
11-MC1's
6 - N2's - Has thanked: 10 times
- Been thanked: 1 time
- Contact:
Re: SPI Dot-Matrix
So I ended up changing the code to:
and then I changed:
To:
Removing the space out of "%s " and now dot_shift_test.c original code compiles no errors on both the XU4 and the N2.
I'm not sure that I fixed anything, maybe I just covered up some underlying issue instead.
So, for the time being... it's happy and working with my 8x32 matrix and I have it running an 8x64 matrix as well. With modifications of course.
Next I'll fix my hardware issue on my 8x96 matrix and it should work fine there as well.
Code: Select all
#define MAX_SHIFT_CHAR_COUNT sizeof(START_STR)
Code: Select all
shift_len = sprintf(&disp_str[0], "%s ", START_STR);
Code: Select all
shift_len = sprintf(&disp_str[0], "%s", START_STR);
I'm not sure that I fixed anything, maybe I just covered up some underlying issue instead.
So, for the time being... it's happy and working with my 8x32 matrix and I have it running an 8x64 matrix as well. With modifications of course.
Next I'll fix my hardware issue on my 8x96 matrix and it should work fine there as well.
Who is online
Users browsing this forum: No registered users and 0 guests