1 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
2 |
DENIED
|
moderate
|
App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
} |
|
Show voter details
|
3 |
DENIED
|
edit
|
App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
} |
|
Show voter details
|
4 |
DENIED
|
moderate
|
App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
} |
|
Show voter details
|
5 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
6 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
} |
|
Show voter details
|
7 |
DENIED
|
edit
|
App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
} |
|
Show voter details
|
8 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
} |
|
Show voter details
|
9 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
10 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4288
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: """
You’re 100% right, I’ve lost ‘i’ somewhere in my debugging process\n
\n
byte upper_byte = input_bin >> (8+i) ; byte lower_byte = (input_bin >> i) & 0x00FF;
"""
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882392 {#4286
date: 2023-09-28 08:26:32.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4289 …}
+nested: Doctrine\ORM\PersistentCollection {#4291 …}
+votes: Doctrine\ORM\PersistentCollection {#4293 …}
+reports: Doctrine\ORM\PersistentCollection {#4295 …}
+favourites: Doctrine\ORM\PersistentCollection {#4297 …}
+notifications: Doctrine\ORM\PersistentCollection {#4299 …}
-id: 29968
-bodyTs: "'0x00ff':27 '100':3 '8':19 'bin':18,25 'byte':14,16,21,23 'debug':12 'input':17,24 'lost':7 'lower':22 'process':13 're':2 'right':4 'somewher':9 'upper':15 've':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://discuss.tchncs.de/comment/3318416"
+editedAt: null
+createdAt: DateTimeImmutable @1695882392 {#4287
date: 2023-09-28 08:26:32.0 +02:00
}
} |
|
Show voter details
|
11 |
DENIED
|
edit
|
App\Entity\EntryComment {#4288
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: """
You’re 100% right, I’ve lost ‘i’ somewhere in my debugging process\n
\n
byte upper_byte = input_bin >> (8+i) ; byte lower_byte = (input_bin >> i) & 0x00FF;
"""
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882392 {#4286
date: 2023-09-28 08:26:32.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4289 …}
+nested: Doctrine\ORM\PersistentCollection {#4291 …}
+votes: Doctrine\ORM\PersistentCollection {#4293 …}
+reports: Doctrine\ORM\PersistentCollection {#4295 …}
+favourites: Doctrine\ORM\PersistentCollection {#4297 …}
+notifications: Doctrine\ORM\PersistentCollection {#4299 …}
-id: 29968
-bodyTs: "'0x00ff':27 '100':3 '8':19 'bin':18,25 'byte':14,16,21,23 'debug':12 'input':17,24 'lost':7 'lower':22 'process':13 're':2 'right':4 'somewher':9 'upper':15 've':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://discuss.tchncs.de/comment/3318416"
+editedAt: null
+createdAt: DateTimeImmutable @1695882392 {#4287
date: 2023-09-28 08:26:32.0 +02:00
}
} |
|
Show voter details
|
12 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4288
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: """
You’re 100% right, I’ve lost ‘i’ somewhere in my debugging process\n
\n
byte upper_byte = input_bin >> (8+i) ; byte lower_byte = (input_bin >> i) & 0x00FF;
"""
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882392 {#4286
date: 2023-09-28 08:26:32.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4289 …}
+nested: Doctrine\ORM\PersistentCollection {#4291 …}
+votes: Doctrine\ORM\PersistentCollection {#4293 …}
+reports: Doctrine\ORM\PersistentCollection {#4295 …}
+favourites: Doctrine\ORM\PersistentCollection {#4297 …}
+notifications: Doctrine\ORM\PersistentCollection {#4299 …}
-id: 29968
-bodyTs: "'0x00ff':27 '100':3 '8':19 'bin':18,25 'byte':14,16,21,23 'debug':12 'input':17,24 'lost':7 'lower':22 'process':13 're':2 'right':4 'somewher':9 'upper':15 've':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://discuss.tchncs.de/comment/3318416"
+editedAt: null
+createdAt: DateTimeImmutable @1695882392 {#4287
date: 2023-09-28 08:26:32.0 +02:00
}
} |
|
Show voter details
|
13 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
14 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
} |
|
Show voter details
|
15 |
DENIED
|
edit
|
App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
} |
|
Show voter details
|
16 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
} |
|
Show voter details
|
17 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
18 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
} |
|
Show voter details
|
19 |
DENIED
|
edit
|
App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
} |
|
Show voter details
|
20 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
} |
|
Show voter details
|
21 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
22 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4394
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think what he refers to is that you seem to do a bitwise or for the second line instead of the bitwise and."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695880005 {#4391
date: 2023-09-28 07:46:45.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4395 …}
+nested: Doctrine\ORM\PersistentCollection {#4397 …}
+votes: Doctrine\ORM\PersistentCollection {#4399 …}
+reports: Doctrine\ORM\PersistentCollection {#4401 …}
+favourites: Doctrine\ORM\PersistentCollection {#4403 …}
+notifications: Doctrine\ORM\PersistentCollection {#4405 …}
-id: 29963
-bodyTs: "'bitwis':14,23 'instead':20 'line':19 'refer':5 'second':18 'seem':10 'think':2"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282813"
+editedAt: DateTimeImmutable @1695880083 {#4392
date: 2023-09-28 07:48:03.0 +02:00
}
+createdAt: DateTimeImmutable @1695880005 {#4393
date: 2023-09-28 07:46:45.0 +02:00
}
} |
|
Show voter details
|
23 |
DENIED
|
edit
|
App\Entity\EntryComment {#4394
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think what he refers to is that you seem to do a bitwise or for the second line instead of the bitwise and."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695880005 {#4391
date: 2023-09-28 07:46:45.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4395 …}
+nested: Doctrine\ORM\PersistentCollection {#4397 …}
+votes: Doctrine\ORM\PersistentCollection {#4399 …}
+reports: Doctrine\ORM\PersistentCollection {#4401 …}
+favourites: Doctrine\ORM\PersistentCollection {#4403 …}
+notifications: Doctrine\ORM\PersistentCollection {#4405 …}
-id: 29963
-bodyTs: "'bitwis':14,23 'instead':20 'line':19 'refer':5 'second':18 'seem':10 'think':2"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282813"
+editedAt: DateTimeImmutable @1695880083 {#4392
date: 2023-09-28 07:48:03.0 +02:00
}
+createdAt: DateTimeImmutable @1695880005 {#4393
date: 2023-09-28 07:46:45.0 +02:00
}
} |
|
Show voter details
|
24 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4394
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think what he refers to is that you seem to do a bitwise or for the second line instead of the bitwise and."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695880005 {#4391
date: 2023-09-28 07:46:45.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4395 …}
+nested: Doctrine\ORM\PersistentCollection {#4397 …}
+votes: Doctrine\ORM\PersistentCollection {#4399 …}
+reports: Doctrine\ORM\PersistentCollection {#4401 …}
+favourites: Doctrine\ORM\PersistentCollection {#4403 …}
+notifications: Doctrine\ORM\PersistentCollection {#4405 …}
-id: 29963
-bodyTs: "'bitwis':14,23 'instead':20 'line':19 'refer':5 'second':18 'seem':10 'think':2"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282813"
+editedAt: DateTimeImmutable @1695880083 {#4392
date: 2023-09-28 07:48:03.0 +02:00
}
+createdAt: DateTimeImmutable @1695880005 {#4393
date: 2023-09-28 07:46:45.0 +02:00
}
} |
|
Show voter details
|
25 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
26 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4432
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4394
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think what he refers to is that you seem to do a bitwise or for the second line instead of the bitwise and."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695880005 {#4391
date: 2023-09-28 07:46:45.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4395 …}
+nested: Doctrine\ORM\PersistentCollection {#4397 …}
+votes: Doctrine\ORM\PersistentCollection {#4399 …}
+reports: Doctrine\ORM\PersistentCollection {#4401 …}
+favourites: Doctrine\ORM\PersistentCollection {#4403 …}
+notifications: Doctrine\ORM\PersistentCollection {#4405 …}
-id: 29963
-bodyTs: "'bitwis':14,23 'instead':20 'line':19 'refer':5 'second':18 'seem':10 'think':2"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282813"
+editedAt: DateTimeImmutable @1695880083 {#4392
date: 2023-09-28 07:48:03.0 +02:00
}
+createdAt: DateTimeImmutable @1695880005 {#4393
date: 2023-09-28 07:46:45.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "2nd line of what? Oh you are completely right. My bad. Idk why I wrote that. I’ll fix my comment."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882892 {#4429
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
"@FuzzChef@feddit.de"
]
+children: Doctrine\ORM\PersistentCollection {#4433 …}
+nested: Doctrine\ORM\PersistentCollection {#4435 …}
+votes: Doctrine\ORM\PersistentCollection {#4437 …}
+reports: Doctrine\ORM\PersistentCollection {#4439 …}
+favourites: Doctrine\ORM\PersistentCollection {#4441 …}
+notifications: Doctrine\ORM\PersistentCollection {#4443 …}
-id: 29970
-bodyTs: "'2nd':1 'bad':11 'comment':21 'complet':8 'fix':19 'idk':12 'line':2 'll':18 'oh':5 'right':9 'wrote':15"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4064314"
+editedAt: DateTimeImmutable @1695883114 {#4430
date: 2023-09-28 08:38:34.0 +02:00
}
+createdAt: DateTimeImmutable @1695882892 {#4431
date: 2023-09-28 08:34:52.0 +02:00
}
} |
|
Show voter details
|
27 |
DENIED
|
edit
|
App\Entity\EntryComment {#4432
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4394
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think what he refers to is that you seem to do a bitwise or for the second line instead of the bitwise and."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695880005 {#4391
date: 2023-09-28 07:46:45.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4395 …}
+nested: Doctrine\ORM\PersistentCollection {#4397 …}
+votes: Doctrine\ORM\PersistentCollection {#4399 …}
+reports: Doctrine\ORM\PersistentCollection {#4401 …}
+favourites: Doctrine\ORM\PersistentCollection {#4403 …}
+notifications: Doctrine\ORM\PersistentCollection {#4405 …}
-id: 29963
-bodyTs: "'bitwis':14,23 'instead':20 'line':19 'refer':5 'second':18 'seem':10 'think':2"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282813"
+editedAt: DateTimeImmutable @1695880083 {#4392
date: 2023-09-28 07:48:03.0 +02:00
}
+createdAt: DateTimeImmutable @1695880005 {#4393
date: 2023-09-28 07:46:45.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "2nd line of what? Oh you are completely right. My bad. Idk why I wrote that. I’ll fix my comment."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882892 {#4429
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
"@FuzzChef@feddit.de"
]
+children: Doctrine\ORM\PersistentCollection {#4433 …}
+nested: Doctrine\ORM\PersistentCollection {#4435 …}
+votes: Doctrine\ORM\PersistentCollection {#4437 …}
+reports: Doctrine\ORM\PersistentCollection {#4439 …}
+favourites: Doctrine\ORM\PersistentCollection {#4441 …}
+notifications: Doctrine\ORM\PersistentCollection {#4443 …}
-id: 29970
-bodyTs: "'2nd':1 'bad':11 'comment':21 'complet':8 'fix':19 'idk':12 'line':2 'll':18 'oh':5 'right':9 'wrote':15"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4064314"
+editedAt: DateTimeImmutable @1695883114 {#4430
date: 2023-09-28 08:38:34.0 +02:00
}
+createdAt: DateTimeImmutable @1695882892 {#4431
date: 2023-09-28 08:34:52.0 +02:00
}
} |
|
Show voter details
|
28 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4432
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4394
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think what he refers to is that you seem to do a bitwise or for the second line instead of the bitwise and."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695880005 {#4391
date: 2023-09-28 07:46:45.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4395 …}
+nested: Doctrine\ORM\PersistentCollection {#4397 …}
+votes: Doctrine\ORM\PersistentCollection {#4399 …}
+reports: Doctrine\ORM\PersistentCollection {#4401 …}
+favourites: Doctrine\ORM\PersistentCollection {#4403 …}
+notifications: Doctrine\ORM\PersistentCollection {#4405 …}
-id: 29963
-bodyTs: "'bitwis':14,23 'instead':20 'line':19 'refer':5 'second':18 'seem':10 'think':2"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282813"
+editedAt: DateTimeImmutable @1695880083 {#4392
date: 2023-09-28 07:48:03.0 +02:00
}
+createdAt: DateTimeImmutable @1695880005 {#4393
date: 2023-09-28 07:46:45.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "2nd line of what? Oh you are completely right. My bad. Idk why I wrote that. I’ll fix my comment."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882892 {#4429
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
"@FuzzChef@feddit.de"
]
+children: Doctrine\ORM\PersistentCollection {#4433 …}
+nested: Doctrine\ORM\PersistentCollection {#4435 …}
+votes: Doctrine\ORM\PersistentCollection {#4437 …}
+reports: Doctrine\ORM\PersistentCollection {#4439 …}
+favourites: Doctrine\ORM\PersistentCollection {#4441 …}
+notifications: Doctrine\ORM\PersistentCollection {#4443 …}
-id: 29970
-bodyTs: "'2nd':1 'bad':11 'comment':21 'complet':8 'fix':19 'idk':12 'line':2 'll':18 'oh':5 'right':9 'wrote':15"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4064314"
+editedAt: DateTimeImmutable @1695883114 {#4430
date: 2023-09-28 08:38:34.0 +02:00
}
+createdAt: DateTimeImmutable @1695882892 {#4431
date: 2023-09-28 08:34:52.0 +02:00
}
} |
|
Show voter details
|
29 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
30 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4447
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4394
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think what he refers to is that you seem to do a bitwise or for the second line instead of the bitwise and."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695880005 {#4391
date: 2023-09-28 07:46:45.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4395 …}
+nested: Doctrine\ORM\PersistentCollection {#4397 …}
+votes: Doctrine\ORM\PersistentCollection {#4399 …}
+reports: Doctrine\ORM\PersistentCollection {#4401 …}
+favourites: Doctrine\ORM\PersistentCollection {#4403 …}
+notifications: Doctrine\ORM\PersistentCollection {#4405 …}
-id: 29963
-bodyTs: "'bitwis':14,23 'instead':20 'line':19 'refer':5 'second':18 'seem':10 'think':2"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282813"
+editedAt: DateTimeImmutable @1695880083 {#4392
date: 2023-09-28 07:48:03.0 +02:00
}
+createdAt: DateTimeImmutable @1695880005 {#4393
date: 2023-09-28 07:46:45.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "Yes that’s what I was thinking"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882862 {#4445
date: 2023-09-28 08:34:22.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
"@FuzzChef@feddit.de"
]
+children: Doctrine\ORM\PersistentCollection {#4448 …}
+nested: Doctrine\ORM\PersistentCollection {#4450 …}
+votes: Doctrine\ORM\PersistentCollection {#4452 …}
+reports: Doctrine\ORM\PersistentCollection {#4454 …}
+favourites: Doctrine\ORM\PersistentCollection {#4456 …}
+notifications: Doctrine\ORM\PersistentCollection {#4458 …}
-id: 29969
-bodyTs: "'think':7 'yes':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3861373"
+editedAt: null
+createdAt: DateTimeImmutable @1695882862 {#4446
date: 2023-09-28 08:34:22.0 +02:00
}
} |
|
Show voter details
|
31 |
DENIED
|
edit
|
App\Entity\EntryComment {#4447
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4394
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think what he refers to is that you seem to do a bitwise or for the second line instead of the bitwise and."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695880005 {#4391
date: 2023-09-28 07:46:45.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4395 …}
+nested: Doctrine\ORM\PersistentCollection {#4397 …}
+votes: Doctrine\ORM\PersistentCollection {#4399 …}
+reports: Doctrine\ORM\PersistentCollection {#4401 …}
+favourites: Doctrine\ORM\PersistentCollection {#4403 …}
+notifications: Doctrine\ORM\PersistentCollection {#4405 …}
-id: 29963
-bodyTs: "'bitwis':14,23 'instead':20 'line':19 'refer':5 'second':18 'seem':10 'think':2"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282813"
+editedAt: DateTimeImmutable @1695880083 {#4392
date: 2023-09-28 07:48:03.0 +02:00
}
+createdAt: DateTimeImmutable @1695880005 {#4393
date: 2023-09-28 07:46:45.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "Yes that’s what I was thinking"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882862 {#4445
date: 2023-09-28 08:34:22.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
"@FuzzChef@feddit.de"
]
+children: Doctrine\ORM\PersistentCollection {#4448 …}
+nested: Doctrine\ORM\PersistentCollection {#4450 …}
+votes: Doctrine\ORM\PersistentCollection {#4452 …}
+reports: Doctrine\ORM\PersistentCollection {#4454 …}
+favourites: Doctrine\ORM\PersistentCollection {#4456 …}
+notifications: Doctrine\ORM\PersistentCollection {#4458 …}
-id: 29969
-bodyTs: "'think':7 'yes':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3861373"
+editedAt: null
+createdAt: DateTimeImmutable @1695882862 {#4446
date: 2023-09-28 08:34:22.0 +02:00
}
} |
|
Show voter details
|
32 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4447
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4394
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4337
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4303
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4059
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: """
The first two lines of the for loop,\n
\n
```\n
\n
<span style="color:#323232;">byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;">byte lower_byte = input_bin & 0x00FF;\n
</span>\n
```\n
\n
don’t really accomplish anything. The first line is bit shifting to the right 8, and then you just bitwise and it resulting in the same thing. For example, starting with `input_bin`:\n
\n
```\n
\n
<span style="color:#323232;">1000 0000 0000 0000\n
</span><span style="color:#323232;">>> 8\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span><span style="color:#323232;">& 0xFF\n
</span><span style="color:#323232;">0000 0000 1000 0000\n
</span>\n
```\n
\n
So, every time you go through a cycle of the for loop, you’ll just start with the same values in `upper_byte`, and `lower_byte`. To sequentially output each shifted value, you’ll instead want something like:\n
\n
```\n
\n
<span style="color:#323232;">output_value = 0b1\n
</span><span style="color:#323232;">for i = 1 to 16:\n
</span><span style="color:#323232;"> latch(low)\n
</span><span style="color:#323232;"> shift_out(output_value)\n
</span><span style="color:#323232;"> latch(high)\n
</span><span style="color:#323232;"> output_value = output_value << 1\n
</span>\n
```\n
\n
That is, if I interpereted correctly that you want the shift registers to output the following:\n
\n
```\n
\n
<span style="color:#323232;">output_count, upper_shift_register, lower_shift_register\n
</span><span style="color:#323232;">1, 00000000, 00000001\n
</span><span style="color:#323232;">2, 00000000, 00000010\n
</span><span style="color:#323232;">3, 00000000, 00000100\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">.\n
</span><span style="color:#323232;">16, 10000000, 00000000\n
</span>\n
```\n
\n
Note: Lemmy has a bug where it doesn’t format some symbols correctly, so the left angle bracket gets formatted as `<`. The same issue exists for the right angle bracket, the ampersand, and I would presume others.
"""
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882894 {#4069
date: 2023-09-28 08:34:54.0 +02:00
}
+ip: null
+tags: [
"323232"
]
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4057 …}
+nested: Doctrine\ORM\PersistentCollection {#4055 …}
+votes: Doctrine\ORM\PersistentCollection {#4053 …}
+reports: Doctrine\ORM\PersistentCollection {#4051 …}
+favourites: Doctrine\ORM\PersistentCollection {#4019 …}
+notifications: Doctrine\ORM\PersistentCollection {#4023 …}
-id: 29950
-bodyTs: "'0000':55,56,57,59,60,62,64,65,67 '00000000':152,155,158,162 '00000001':153 '00000010':156 '00000100':159 '0b1':108 '0x00ff':20 '0xff':63 '1':111,126,151 '1000':54,61,66 '10000000':161 '16':113,160 '2':154 '3':157 '8':14,35,58 'accomplish':24 'ampersand':194 'angl':179,191 'anyth':25 'bin':13,19,53 'bit':30 'bitwis':40 'bracket':180,192 'bug':167 'byte':9,11,15,17,90,93 'correct':132,175 'count':144 'cycl':75 'doesn':170 'everi':69 'exampl':49 'exist':187 'first':2,27 'follow':142 'format':172,182 'get':181 'go':72 'high':121 'input':12,18,52 'instead':102 'interperet':131 'issu':186 'latch':114,120 'left':178 'lemmi':164 'like':105 'line':4,28 'll':81,101 'loop':8,79 'low':115 'lower':16,92,148 'note':163 'other':199 'output':96,106,118,122,124,140,143 'presum':198 'realli':23 'regist':138,147,150 'result':43 'right':34,190 'sequenti':95 'shift':31,98,116,137,146,149 'someth':104 'start':50,83 'symbol':174 'thing':47 'time':70 'two':3 'upper':10,89,145 'valu':87,99,107,119,123,125 'want':103,135 'would':197"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4055088"
+editedAt: DateTimeImmutable @1695883315 {#4001
date: 2023-09-28 08:41:55.0 +02:00
}
+createdAt: DateTimeImmutable @1695856746 {#4068
date: 2023-09-28 01:19:06.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think you got and and or switched, first two lines should be fine for shifting the top 8 bits down."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868403 {#4301
date: 2023-09-28 04:33:23.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4304 …}
+nested: Doctrine\ORM\PersistentCollection {#4306 …}
+votes: Doctrine\ORM\PersistentCollection {#4308 …}
+reports: Doctrine\ORM\PersistentCollection {#4310 …}
+favourites: Doctrine\ORM\PersistentCollection {#4312 …}
+notifications: Doctrine\ORM\PersistentCollection {#4314 …}
-id: 29956
-bodyTs: "'8':19 'bit':20 'fine':14 'first':9 'got':4 'line':11 'shift':16 'switch':8 'think':2 'top':18 'two':10"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857440"
+editedAt: null
+createdAt: DateTimeImmutable @1695868403 {#4302
date: 2023-09-28 04:33:23.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I don’t follow what you mean."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695873317 {#4336
date: 2023-09-28 05:55:17.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4340 …}
+nested: Doctrine\ORM\PersistentCollection {#4345 …}
+votes: Doctrine\ORM\PersistentCollection {#4341 …}
+reports: Doctrine\ORM\PersistentCollection {#4347 …}
+favourites: Doctrine\ORM\PersistentCollection {#4349 …}
+notifications: Doctrine\ORM\PersistentCollection {#4351 …}
-id: 29961
-bodyTs: "'follow':4 'mean':7"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4061189"
+editedAt: null
+createdAt: DateTimeImmutable @1695873317 {#4333
date: 2023-09-28 05:55:17.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "I think what he refers to is that you seem to do a bitwise or for the second line instead of the bitwise and."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695880005 {#4391
date: 2023-09-28 07:46:45.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4395 …}
+nested: Doctrine\ORM\PersistentCollection {#4397 …}
+votes: Doctrine\ORM\PersistentCollection {#4399 …}
+reports: Doctrine\ORM\PersistentCollection {#4401 …}
+favourites: Doctrine\ORM\PersistentCollection {#4403 …}
+notifications: Doctrine\ORM\PersistentCollection {#4405 …}
-id: 29963
-bodyTs: "'bitwis':14,23 'instead':20 'line':19 'refer':5 'second':18 'seem':10 'think':2"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282813"
+editedAt: DateTimeImmutable @1695880083 {#4392
date: 2023-09-28 07:48:03.0 +02:00
}
+createdAt: DateTimeImmutable @1695880005 {#4393
date: 2023-09-28 07:46:45.0 +02:00
}
}
+root: App\Entity\EntryComment {#4059}
+body: "Yes that’s what I was thinking"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882862 {#4445
date: 2023-09-28 08:34:22.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
"@mvirts@lemmy.world"
"@FuzzChef@feddit.de"
]
+children: Doctrine\ORM\PersistentCollection {#4448 …}
+nested: Doctrine\ORM\PersistentCollection {#4450 …}
+votes: Doctrine\ORM\PersistentCollection {#4452 …}
+reports: Doctrine\ORM\PersistentCollection {#4454 …}
+favourites: Doctrine\ORM\PersistentCollection {#4456 …}
+notifications: Doctrine\ORM\PersistentCollection {#4458 …}
-id: 29969
-bodyTs: "'think':7 'yes':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3861373"
+editedAt: null
+createdAt: DateTimeImmutable @1695882862 {#4446
date: 2023-09-28 08:34:22.0 +02:00
}
} |
|
Show voter details
|
33 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
34 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4103
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would you not want to shift out the upper byte first? I could be misinterpreting your setup."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695848391 {#4110
date: 2023-09-27 22:59:51.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4101 …}
+nested: Doctrine\ORM\PersistentCollection {#4099 …}
+votes: Doctrine\ORM\PersistentCollection {#4097 …}
+reports: Doctrine\ORM\PersistentCollection {#4096 …}
+favourites: Doctrine\ORM\PersistentCollection {#4087 …}
+notifications: Doctrine\ORM\PersistentCollection {#4090 …}
-id: 29925
-bodyTs: "'byte':10 'could':13 'first':11 'misinterpret':15 'setup':17 'shift':6 'upper':9 'want':4 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4050427"
+editedAt: DateTimeImmutable @1695847279 {#4111
date: 2023-09-27 22:41:19.0 +02:00
}
+createdAt: DateTimeImmutable @1695847225 {#4108
date: 2023-09-27 22:40:25.0 +02:00
}
} |
|
Show voter details
|
35 |
DENIED
|
edit
|
App\Entity\EntryComment {#4103
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would you not want to shift out the upper byte first? I could be misinterpreting your setup."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695848391 {#4110
date: 2023-09-27 22:59:51.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4101 …}
+nested: Doctrine\ORM\PersistentCollection {#4099 …}
+votes: Doctrine\ORM\PersistentCollection {#4097 …}
+reports: Doctrine\ORM\PersistentCollection {#4096 …}
+favourites: Doctrine\ORM\PersistentCollection {#4087 …}
+notifications: Doctrine\ORM\PersistentCollection {#4090 …}
-id: 29925
-bodyTs: "'byte':10 'could':13 'first':11 'misinterpret':15 'setup':17 'shift':6 'upper':9 'want':4 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4050427"
+editedAt: DateTimeImmutable @1695847279 {#4111
date: 2023-09-27 22:41:19.0 +02:00
}
+createdAt: DateTimeImmutable @1695847225 {#4108
date: 2023-09-27 22:40:25.0 +02:00
}
} |
|
Show voter details
|
36 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4103
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would you not want to shift out the upper byte first? I could be misinterpreting your setup."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695848391 {#4110
date: 2023-09-27 22:59:51.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4101 …}
+nested: Doctrine\ORM\PersistentCollection {#4099 …}
+votes: Doctrine\ORM\PersistentCollection {#4097 …}
+reports: Doctrine\ORM\PersistentCollection {#4096 …}
+favourites: Doctrine\ORM\PersistentCollection {#4087 …}
+notifications: Doctrine\ORM\PersistentCollection {#4090 …}
-id: 29925
-bodyTs: "'byte':10 'could':13 'first':11 'misinterpret':15 'setup':17 'shift':6 'upper':9 'want':4 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4050427"
+editedAt: DateTimeImmutable @1695847279 {#4111
date: 2023-09-27 22:41:19.0 +02:00
}
+createdAt: DateTimeImmutable @1695847225 {#4108
date: 2023-09-27 22:40:25.0 +02:00
}
} |
|
Show voter details
|
37 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
38 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4270
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4103
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would you not want to shift out the upper byte first? I could be misinterpreting your setup."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695848391 {#4110
date: 2023-09-27 22:59:51.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4101 …}
+nested: Doctrine\ORM\PersistentCollection {#4099 …}
+votes: Doctrine\ORM\PersistentCollection {#4097 …}
+reports: Doctrine\ORM\PersistentCollection {#4096 …}
+favourites: Doctrine\ORM\PersistentCollection {#4087 …}
+notifications: Doctrine\ORM\PersistentCollection {#4090 …}
-id: 29925
-bodyTs: "'byte':10 'could':13 'first':11 'misinterpret':15 'setup':17 'shift':6 'upper':9 'want':4 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4050427"
+editedAt: DateTimeImmutable @1695847279 {#4111
date: 2023-09-27 22:41:19.0 +02:00
}
+createdAt: DateTimeImmutable @1695847225 {#4108
date: 2023-09-27 22:40:25.0 +02:00
}
}
+root: App\Entity\EntryComment {#4103}
+body: "You’re probably right, but that should only change the order of the outputs right?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695848390 {#4269
date: 2023-09-27 22:59:50.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4273 …}
+nested: Doctrine\ORM\PersistentCollection {#4278 …}
+votes: Doctrine\ORM\PersistentCollection {#4274 …}
+reports: Doctrine\ORM\PersistentCollection {#4280 …}
+favourites: Doctrine\ORM\PersistentCollection {#4282 …}
+notifications: Doctrine\ORM\PersistentCollection {#4284 …}
-id: 29928
-bodyTs: "'chang':9 'order':11 'output':14 'probabl':3 're':2 'right':4,15"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://discuss.tchncs.de/comment/3308099"
+editedAt: null
+createdAt: DateTimeImmutable @1695848390 {#4266
date: 2023-09-27 22:59:50.0 +02:00
}
} |
|
Show voter details
|
39 |
DENIED
|
edit
|
App\Entity\EntryComment {#4270
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4103
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would you not want to shift out the upper byte first? I could be misinterpreting your setup."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695848391 {#4110
date: 2023-09-27 22:59:51.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4101 …}
+nested: Doctrine\ORM\PersistentCollection {#4099 …}
+votes: Doctrine\ORM\PersistentCollection {#4097 …}
+reports: Doctrine\ORM\PersistentCollection {#4096 …}
+favourites: Doctrine\ORM\PersistentCollection {#4087 …}
+notifications: Doctrine\ORM\PersistentCollection {#4090 …}
-id: 29925
-bodyTs: "'byte':10 'could':13 'first':11 'misinterpret':15 'setup':17 'shift':6 'upper':9 'want':4 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4050427"
+editedAt: DateTimeImmutable @1695847279 {#4111
date: 2023-09-27 22:41:19.0 +02:00
}
+createdAt: DateTimeImmutable @1695847225 {#4108
date: 2023-09-27 22:40:25.0 +02:00
}
}
+root: App\Entity\EntryComment {#4103}
+body: "You’re probably right, but that should only change the order of the outputs right?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695848390 {#4269
date: 2023-09-27 22:59:50.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4273 …}
+nested: Doctrine\ORM\PersistentCollection {#4278 …}
+votes: Doctrine\ORM\PersistentCollection {#4274 …}
+reports: Doctrine\ORM\PersistentCollection {#4280 …}
+favourites: Doctrine\ORM\PersistentCollection {#4282 …}
+notifications: Doctrine\ORM\PersistentCollection {#4284 …}
-id: 29928
-bodyTs: "'chang':9 'order':11 'output':14 'probabl':3 're':2 'right':4,15"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://discuss.tchncs.de/comment/3308099"
+editedAt: null
+createdAt: DateTimeImmutable @1695848390 {#4266
date: 2023-09-27 22:59:50.0 +02:00
}
} |
|
Show voter details
|
40 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4270
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4103
+user: App\Entity\User {#4008 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would you not want to shift out the upper byte first? I could be misinterpreting your setup."
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695848391 {#4110
date: 2023-09-27 22:59:51.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4101 …}
+nested: Doctrine\ORM\PersistentCollection {#4099 …}
+votes: Doctrine\ORM\PersistentCollection {#4097 …}
+reports: Doctrine\ORM\PersistentCollection {#4096 …}
+favourites: Doctrine\ORM\PersistentCollection {#4087 …}
+notifications: Doctrine\ORM\PersistentCollection {#4090 …}
-id: 29925
-bodyTs: "'byte':10 'could':13 'first':11 'misinterpret':15 'setup':17 'shift':6 'upper':9 'want':4 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemm.ee/comment/4050427"
+editedAt: DateTimeImmutable @1695847279 {#4111
date: 2023-09-27 22:41:19.0 +02:00
}
+createdAt: DateTimeImmutable @1695847225 {#4108
date: 2023-09-27 22:40:25.0 +02:00
}
}
+root: App\Entity\EntryComment {#4103}
+body: "You’re probably right, but that should only change the order of the outputs right?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695848390 {#4269
date: 2023-09-27 22:59:50.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@Kalcifer@lemm.ee"
]
+children: Doctrine\ORM\PersistentCollection {#4273 …}
+nested: Doctrine\ORM\PersistentCollection {#4278 …}
+votes: Doctrine\ORM\PersistentCollection {#4274 …}
+reports: Doctrine\ORM\PersistentCollection {#4280 …}
+favourites: Doctrine\ORM\PersistentCollection {#4282 …}
+notifications: Doctrine\ORM\PersistentCollection {#4284 …}
-id: 29928
-bodyTs: "'chang':9 'order':11 'output':14 'probabl':3 're':2 'right':4,15"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://discuss.tchncs.de/comment/3308099"
+editedAt: null
+createdAt: DateTimeImmutable @1695848390 {#4266
date: 2023-09-27 22:59:50.0 +02:00
}
} |
|
Show voter details
|
41 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
42 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4083
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "What does shiftDataOut do? You loop over it but you give the whole byte to it anyway in each loop."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695880391 {#4098
date: 2023-09-28 07:53:11.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4082 …}
+nested: Doctrine\ORM\PersistentCollection {#4080 …}
+votes: Doctrine\ORM\PersistentCollection {#4078 …}
+reports: Doctrine\ORM\PersistentCollection {#4076 …}
+favourites: Doctrine\ORM\PersistentCollection {#4074 …}
+notifications: Doctrine\ORM\PersistentCollection {#4072 …}
-id: 29964
-bodyTs: "'anyway':17 'byte':14 'give':11 'loop':6,20 'shiftdataout':3 'whole':13"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282908"
+editedAt: null
+createdAt: DateTimeImmutable @1695880391 {#4106
date: 2023-09-28 07:53:11.0 +02:00
}
} |
|
Show voter details
|
43 |
DENIED
|
edit
|
App\Entity\EntryComment {#4083
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "What does shiftDataOut do? You loop over it but you give the whole byte to it anyway in each loop."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695880391 {#4098
date: 2023-09-28 07:53:11.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4082 …}
+nested: Doctrine\ORM\PersistentCollection {#4080 …}
+votes: Doctrine\ORM\PersistentCollection {#4078 …}
+reports: Doctrine\ORM\PersistentCollection {#4076 …}
+favourites: Doctrine\ORM\PersistentCollection {#4074 …}
+notifications: Doctrine\ORM\PersistentCollection {#4072 …}
-id: 29964
-bodyTs: "'anyway':17 'byte':14 'give':11 'loop':6,20 'shiftdataout':3 'whole':13"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282908"
+editedAt: null
+createdAt: DateTimeImmutable @1695880391 {#4106
date: 2023-09-28 07:53:11.0 +02:00
}
} |
|
Show voter details
|
44 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4083
+user: App\Entity\User {#4070 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "What does shiftDataOut do? You loop over it but you give the whole byte to it anyway in each loop."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695880391 {#4098
date: 2023-09-28 07:53:11.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4082 …}
+nested: Doctrine\ORM\PersistentCollection {#4080 …}
+votes: Doctrine\ORM\PersistentCollection {#4078 …}
+reports: Doctrine\ORM\PersistentCollection {#4076 …}
+favourites: Doctrine\ORM\PersistentCollection {#4074 …}
+notifications: Doctrine\ORM\PersistentCollection {#4072 …}
-id: 29964
-bodyTs: "'anyway':17 'byte':14 'give':11 'loop':6,20 'shiftdataout':3 'whole':13"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://feddit.de/comment/3282908"
+editedAt: null
+createdAt: DateTimeImmutable @1695880391 {#4106
date: 2023-09-28 07:53:11.0 +02:00
}
} |
|
Show voter details
|
45 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
46 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
} |
|
Show voter details
|
47 |
DENIED
|
edit
|
App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
} |
|
Show voter details
|
48 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
} |
|
Show voter details
|
49 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
50 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
} |
|
Show voter details
|
51 |
DENIED
|
edit
|
App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
} |
|
Show voter details
|
52 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
} |
|
Show voter details
|
53 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
54 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4356
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Hmmmm do you want to write to both shift register at the same time? I say this because you’re looping 16 times, but seem to be sending the high and low bytes out 16 times over rather than one bit each time, although you are shifting the input."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869074 {#4353
date: 2023-09-28 04:44:34.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4357 …}
+nested: Doctrine\ORM\PersistentCollection {#4359 …}
+votes: Doctrine\ORM\PersistentCollection {#4361 …}
+reports: Doctrine\ORM\PersistentCollection {#4363 …}
+favourites: Doctrine\ORM\PersistentCollection {#4365 …}
+notifications: Doctrine\ORM\PersistentCollection {#4367 …}
-id: 29959
-bodyTs: "'16':22,35 'although':44 'bit':41 'byte':33 'high':30 'hmmmm':1 'input':49 'loop':21 'low':32 'one':40 'rather':38 're':20 'regist':10 'say':16 'seem':25 'send':28 'shift':9,47 'time':14,23,36,43 'want':4 'write':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857666"
+editedAt: DateTimeImmutable @1695869154 {#4354
date: 2023-09-28 04:45:54.0 +02:00
}
+createdAt: DateTimeImmutable @1695869074 {#4355
date: 2023-09-28 04:44:34.0 +02:00
}
} |
|
Show voter details
|
55 |
DENIED
|
edit
|
App\Entity\EntryComment {#4356
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Hmmmm do you want to write to both shift register at the same time? I say this because you’re looping 16 times, but seem to be sending the high and low bytes out 16 times over rather than one bit each time, although you are shifting the input."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869074 {#4353
date: 2023-09-28 04:44:34.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4357 …}
+nested: Doctrine\ORM\PersistentCollection {#4359 …}
+votes: Doctrine\ORM\PersistentCollection {#4361 …}
+reports: Doctrine\ORM\PersistentCollection {#4363 …}
+favourites: Doctrine\ORM\PersistentCollection {#4365 …}
+notifications: Doctrine\ORM\PersistentCollection {#4367 …}
-id: 29959
-bodyTs: "'16':22,35 'although':44 'bit':41 'byte':33 'high':30 'hmmmm':1 'input':49 'loop':21 'low':32 'one':40 'rather':38 're':20 'regist':10 'say':16 'seem':25 'send':28 'shift':9,47 'time':14,23,36,43 'want':4 'write':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857666"
+editedAt: DateTimeImmutable @1695869154 {#4354
date: 2023-09-28 04:45:54.0 +02:00
}
+createdAt: DateTimeImmutable @1695869074 {#4355
date: 2023-09-28 04:44:34.0 +02:00
}
} |
|
Show voter details
|
56 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4356
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Hmmmm do you want to write to both shift register at the same time? I say this because you’re looping 16 times, but seem to be sending the high and low bytes out 16 times over rather than one bit each time, although you are shifting the input."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869074 {#4353
date: 2023-09-28 04:44:34.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4357 …}
+nested: Doctrine\ORM\PersistentCollection {#4359 …}
+votes: Doctrine\ORM\PersistentCollection {#4361 …}
+reports: Doctrine\ORM\PersistentCollection {#4363 …}
+favourites: Doctrine\ORM\PersistentCollection {#4365 …}
+notifications: Doctrine\ORM\PersistentCollection {#4367 …}
-id: 29959
-bodyTs: "'16':22,35 'although':44 'bit':41 'byte':33 'high':30 'hmmmm':1 'input':49 'loop':21 'low':32 'one':40 'rather':38 're':20 'regist':10 'say':16 'seem':25 'send':28 'shift':9,47 'time':14,23,36,43 'want':4 'write':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857666"
+editedAt: DateTimeImmutable @1695869154 {#4354
date: 2023-09-28 04:45:54.0 +02:00
}
+createdAt: DateTimeImmutable @1695869074 {#4355
date: 2023-09-28 04:44:34.0 +02:00
}
} |
|
Show voter details
|
57 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
58 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4370
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4356
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Hmmmm do you want to write to both shift register at the same time? I say this because you’re looping 16 times, but seem to be sending the high and low bytes out 16 times over rather than one bit each time, although you are shifting the input."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869074 {#4353
date: 2023-09-28 04:44:34.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4357 …}
+nested: Doctrine\ORM\PersistentCollection {#4359 …}
+votes: Doctrine\ORM\PersistentCollection {#4361 …}
+reports: Doctrine\ORM\PersistentCollection {#4363 …}
+favourites: Doctrine\ORM\PersistentCollection {#4365 …}
+notifications: Doctrine\ORM\PersistentCollection {#4367 …}
-id: 29959
-bodyTs: "'16':22,35 'although':44 'bit':41 'byte':33 'high':30 'hmmmm':1 'input':49 'loop':21 'low':32 'one':40 'rather':38 're':20 'regist':10 'say':16 'seem':25 'send':28 'shift':9,47 'time':14,23,36,43 'want':4 'write':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857666"
+editedAt: DateTimeImmutable @1695869154 {#4354
date: 2023-09-28 04:45:54.0 +02:00
}
+createdAt: DateTimeImmutable @1695869074 {#4355
date: 2023-09-28 04:44:34.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Maybe I’m getting ahead of myself, but maybe try using digitalWrite for a single bit instead of shiftDataOut?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869203 {#4375
date: 2023-09-28 04:46:43.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4378 …}
+nested: Doctrine\ORM\PersistentCollection {#4382 …}
+votes: Doctrine\ORM\PersistentCollection {#4384 …}
+reports: Doctrine\ORM\PersistentCollection {#4385 …}
+favourites: Doctrine\ORM\PersistentCollection {#4387 …}
+notifications: Doctrine\ORM\PersistentCollection {#4389 …}
-id: 29960
-bodyTs: "'ahead':5 'bit':16 'digitalwrit':12 'get':4 'instead':17 'm':3 'mayb':1,9 'shiftdataout':19 'singl':15 'tri':10 'use':11"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857706"
+editedAt: null
+createdAt: DateTimeImmutable @1695869203 {#4372
date: 2023-09-28 04:46:43.0 +02:00
}
} |
|
Show voter details
|
59 |
DENIED
|
edit
|
App\Entity\EntryComment {#4370
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4356
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Hmmmm do you want to write to both shift register at the same time? I say this because you’re looping 16 times, but seem to be sending the high and low bytes out 16 times over rather than one bit each time, although you are shifting the input."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869074 {#4353
date: 2023-09-28 04:44:34.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4357 …}
+nested: Doctrine\ORM\PersistentCollection {#4359 …}
+votes: Doctrine\ORM\PersistentCollection {#4361 …}
+reports: Doctrine\ORM\PersistentCollection {#4363 …}
+favourites: Doctrine\ORM\PersistentCollection {#4365 …}
+notifications: Doctrine\ORM\PersistentCollection {#4367 …}
-id: 29959
-bodyTs: "'16':22,35 'although':44 'bit':41 'byte':33 'high':30 'hmmmm':1 'input':49 'loop':21 'low':32 'one':40 'rather':38 're':20 'regist':10 'say':16 'seem':25 'send':28 'shift':9,47 'time':14,23,36,43 'want':4 'write':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857666"
+editedAt: DateTimeImmutable @1695869154 {#4354
date: 2023-09-28 04:45:54.0 +02:00
}
+createdAt: DateTimeImmutable @1695869074 {#4355
date: 2023-09-28 04:44:34.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Maybe I’m getting ahead of myself, but maybe try using digitalWrite for a single bit instead of shiftDataOut?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869203 {#4375
date: 2023-09-28 04:46:43.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4378 …}
+nested: Doctrine\ORM\PersistentCollection {#4382 …}
+votes: Doctrine\ORM\PersistentCollection {#4384 …}
+reports: Doctrine\ORM\PersistentCollection {#4385 …}
+favourites: Doctrine\ORM\PersistentCollection {#4387 …}
+notifications: Doctrine\ORM\PersistentCollection {#4389 …}
-id: 29960
-bodyTs: "'ahead':5 'bit':16 'digitalwrit':12 'get':4 'instead':17 'm':3 'mayb':1,9 'shiftdataout':19 'singl':15 'tri':10 'use':11"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857706"
+editedAt: null
+createdAt: DateTimeImmutable @1695869203 {#4372
date: 2023-09-28 04:46:43.0 +02:00
}
} |
|
Show voter details
|
60 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4370
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4356
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Hmmmm do you want to write to both shift register at the same time? I say this because you’re looping 16 times, but seem to be sending the high and low bytes out 16 times over rather than one bit each time, although you are shifting the input."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869074 {#4353
date: 2023-09-28 04:44:34.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4357 …}
+nested: Doctrine\ORM\PersistentCollection {#4359 …}
+votes: Doctrine\ORM\PersistentCollection {#4361 …}
+reports: Doctrine\ORM\PersistentCollection {#4363 …}
+favourites: Doctrine\ORM\PersistentCollection {#4365 …}
+notifications: Doctrine\ORM\PersistentCollection {#4367 …}
-id: 29959
-bodyTs: "'16':22,35 'although':44 'bit':41 'byte':33 'high':30 'hmmmm':1 'input':49 'loop':21 'low':32 'one':40 'rather':38 're':20 'regist':10 'say':16 'seem':25 'send':28 'shift':9,47 'time':14,23,36,43 'want':4 'write':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857666"
+editedAt: DateTimeImmutable @1695869154 {#4354
date: 2023-09-28 04:45:54.0 +02:00
}
+createdAt: DateTimeImmutable @1695869074 {#4355
date: 2023-09-28 04:44:34.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Maybe I’m getting ahead of myself, but maybe try using digitalWrite for a single bit instead of shiftDataOut?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869203 {#4375
date: 2023-09-28 04:46:43.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4378 …}
+nested: Doctrine\ORM\PersistentCollection {#4382 …}
+votes: Doctrine\ORM\PersistentCollection {#4384 …}
+reports: Doctrine\ORM\PersistentCollection {#4385 …}
+favourites: Doctrine\ORM\PersistentCollection {#4387 …}
+notifications: Doctrine\ORM\PersistentCollection {#4389 …}
-id: 29960
-bodyTs: "'ahead':5 'bit':16 'digitalwrit':12 'get':4 'instead':17 'm':3 'mayb':1,9 'shiftdataout':19 'singl':15 'tri':10 'use':11"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857706"
+editedAt: null
+createdAt: DateTimeImmutable @1695869203 {#4372
date: 2023-09-28 04:46:43.0 +02:00
}
} |
|
Show voter details
|
61 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
62 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4408
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4370
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4356
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Hmmmm do you want to write to both shift register at the same time? I say this because you’re looping 16 times, but seem to be sending the high and low bytes out 16 times over rather than one bit each time, although you are shifting the input."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869074 {#4353
date: 2023-09-28 04:44:34.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4357 …}
+nested: Doctrine\ORM\PersistentCollection {#4359 …}
+votes: Doctrine\ORM\PersistentCollection {#4361 …}
+reports: Doctrine\ORM\PersistentCollection {#4363 …}
+favourites: Doctrine\ORM\PersistentCollection {#4365 …}
+notifications: Doctrine\ORM\PersistentCollection {#4367 …}
-id: 29959
-bodyTs: "'16':22,35 'although':44 'bit':41 'byte':33 'high':30 'hmmmm':1 'input':49 'loop':21 'low':32 'one':40 'rather':38 're':20 'regist':10 'say':16 'seem':25 'send':28 'shift':9,47 'time':14,23,36,43 'want':4 'write':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857666"
+editedAt: DateTimeImmutable @1695869154 {#4354
date: 2023-09-28 04:45:54.0 +02:00
}
+createdAt: DateTimeImmutable @1695869074 {#4355
date: 2023-09-28 04:44:34.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Maybe I’m getting ahead of myself, but maybe try using digitalWrite for a single bit instead of shiftDataOut?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869203 {#4375
date: 2023-09-28 04:46:43.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4378 …}
+nested: Doctrine\ORM\PersistentCollection {#4382 …}
+votes: Doctrine\ORM\PersistentCollection {#4384 …}
+reports: Doctrine\ORM\PersistentCollection {#4385 …}
+favourites: Doctrine\ORM\PersistentCollection {#4387 …}
+notifications: Doctrine\ORM\PersistentCollection {#4389 …}
-id: 29960
-bodyTs: "'ahead':5 'bit':16 'digitalwrit':12 'get':4 'instead':17 'm':3 'mayb':1,9 'shiftdataout':19 'singl':15 'tri':10 'use':11"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857706"
+editedAt: null
+createdAt: DateTimeImmutable @1695869203 {#4372
date: 2023-09-28 04:46:43.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Good idea, I’ve tried usleep after all lines, but no change…"
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882009 {#4413
date: 2023-09-28 08:20:09.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4416 …}
+nested: Doctrine\ORM\PersistentCollection {#4420 …}
+votes: Doctrine\ORM\PersistentCollection {#4422 …}
+reports: Doctrine\ORM\PersistentCollection {#4423 …}
+favourites: Doctrine\ORM\PersistentCollection {#4425 …}
+notifications: Doctrine\ORM\PersistentCollection {#4427 …}
-id: 29967
-bodyTs: "'chang':12 'good':1 'idea':2 'line':9 'tri':5 'usleep':6 've':4"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://discuss.tchncs.de/comment/3318310"
+editedAt: null
+createdAt: DateTimeImmutable @1695882009 {#4410
date: 2023-09-28 08:20:09.0 +02:00
}
} |
|
Show voter details
|
63 |
DENIED
|
edit
|
App\Entity\EntryComment {#4408
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4370
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4356
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Hmmmm do you want to write to both shift register at the same time? I say this because you’re looping 16 times, but seem to be sending the high and low bytes out 16 times over rather than one bit each time, although you are shifting the input."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869074 {#4353
date: 2023-09-28 04:44:34.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4357 …}
+nested: Doctrine\ORM\PersistentCollection {#4359 …}
+votes: Doctrine\ORM\PersistentCollection {#4361 …}
+reports: Doctrine\ORM\PersistentCollection {#4363 …}
+favourites: Doctrine\ORM\PersistentCollection {#4365 …}
+notifications: Doctrine\ORM\PersistentCollection {#4367 …}
-id: 29959
-bodyTs: "'16':22,35 'although':44 'bit':41 'byte':33 'high':30 'hmmmm':1 'input':49 'loop':21 'low':32 'one':40 'rather':38 're':20 'regist':10 'say':16 'seem':25 'send':28 'shift':9,47 'time':14,23,36,43 'want':4 'write':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857666"
+editedAt: DateTimeImmutable @1695869154 {#4354
date: 2023-09-28 04:45:54.0 +02:00
}
+createdAt: DateTimeImmutable @1695869074 {#4355
date: 2023-09-28 04:44:34.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Maybe I’m getting ahead of myself, but maybe try using digitalWrite for a single bit instead of shiftDataOut?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869203 {#4375
date: 2023-09-28 04:46:43.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4378 …}
+nested: Doctrine\ORM\PersistentCollection {#4382 …}
+votes: Doctrine\ORM\PersistentCollection {#4384 …}
+reports: Doctrine\ORM\PersistentCollection {#4385 …}
+favourites: Doctrine\ORM\PersistentCollection {#4387 …}
+notifications: Doctrine\ORM\PersistentCollection {#4389 …}
-id: 29960
-bodyTs: "'ahead':5 'bit':16 'digitalwrit':12 'get':4 'instead':17 'm':3 'mayb':1,9 'shiftdataout':19 'singl':15 'tri':10 'use':11"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857706"
+editedAt: null
+createdAt: DateTimeImmutable @1695869203 {#4372
date: 2023-09-28 04:46:43.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Good idea, I’ve tried usleep after all lines, but no change…"
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882009 {#4413
date: 2023-09-28 08:20:09.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4416 …}
+nested: Doctrine\ORM\PersistentCollection {#4420 …}
+votes: Doctrine\ORM\PersistentCollection {#4422 …}
+reports: Doctrine\ORM\PersistentCollection {#4423 …}
+favourites: Doctrine\ORM\PersistentCollection {#4425 …}
+notifications: Doctrine\ORM\PersistentCollection {#4427 …}
-id: 29967
-bodyTs: "'chang':12 'good':1 'idea':2 'line':9 'tri':5 'usleep':6 've':4"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://discuss.tchncs.de/comment/3318310"
+editedAt: null
+createdAt: DateTimeImmutable @1695882009 {#4410
date: 2023-09-28 08:20:09.0 +02:00
}
} |
|
Show voter details
|
64 |
DENIED
|
moderate
|
App\Entity\EntryComment {#4408
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+entry: App\Entity\Entry {#2413
+user: Proxies\__CG__\App\Entity\User {#1973 …}
+magazine: App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
}
+image: Proxies\__CG__\App\Entity\Image {#1978 …}
+domain: Proxies\__CG__\App\Entity\Domain {#1889 …}
+slug: "Shift-register-missing-bits"
+title: "Shift register missing bits"
+url: "https://discuss.tchncs.de/pictrs/image/7da4f08e-8d93-4cf1-99c9-22f2aea08d32.png"
+body: """
Hey friends,\n
\n
I have a two [daisy chained shift registers](https://i.imgur.com/tZBQ45e.png) ([74AHC595](https://www.diodes.com/assets/Datasheets/74AHC595.pdf)) which are controlled via an ESP32. I want to set one output to high at a time before switching to the next.\n
\n
The code seems to work, but the outputs O_9 and O_10 are not [staying high](https://i.imgur.com/v5OOE1K.png) ([zoom](https://i.imgur.com/VpMbdW3.png)) after setting them, whereas all the other ones are working fine. This is the used code snipped:\n
\n
```\n
\n
<span style="color:#323232;">pinMode(SHIFT_OUT_DATA, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_CLK, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_N_EN, OUTPUT);\n
</span><span style="color:#323232;">pinMode(SHIFT_OUT_LATCH, OUTPUT);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">digitalWrite(SHIFT_OUT_N_EN, LOW);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">uint16_t input_bin = 0b1000000000000000;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;">for(int i=0; i<17; i++){\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> byte upper_byte = input_bin >> 8;\n
</span><span style="color:#323232;"> byte lower_byte = input_bin & 0x00FF;\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, LOW);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, lower_byte);\n
</span><span style="color:#323232;"> shiftDataOut(SHIFT_OUT_DATA, SHIFT_OUT_CLK, MSBFIRST, upper_byte);\n
</span><span style="color:#323232;"> usleep(10);\n
</span><span style="color:#323232;"> digitalWrite(SHIFT_OUT_LATCH, HIGH);\n
</span><span style="color:#323232;">\n
</span><span style="color:#323232;"> delay(10)\n
</span><span style="color:#323232;"> input_bin = input_bin>>1;\n
</span><span style="color:#323232;">} \n
</span>\n
```\n
\n
Is there anything I’m doing wrong, or any idea on where the problem may lie? I’ve already tried looking for shorts and other error sources, but the design was manufactured on a PCB and no assembly issues are noticeable.
"""
+type: "image"
+lang: "en"
+isOc: false
+hasEmbed: true
+commentCount: 15
+favouriteCount: 13
+score: 0
+isAdult: false
+sticky: false
+lastActive: DateTime @1695882892 {#2418
date: 2023-09-28 08:34:52.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#1688 …}
+votes: Doctrine\ORM\PersistentCollection {#1934 …}
+reports: Doctrine\ORM\PersistentCollection {#1965 …}
+favourites: Doctrine\ORM\PersistentCollection {#1396 …}
+notifications: Doctrine\ORM\PersistentCollection {#2439 …}
+badges: Doctrine\ORM\PersistentCollection {#2357 …}
+children: []
-id: 2357
-titleTs: "'bit':4 'miss':3 'regist':2 'shift':1"
-bodyTs: "'/assets/datasheets/74ahc595.pdf))':17 '/tzbq45e.png)':13 '/v5ooe1k.png)':59 '/vpmbdw3.png))':63 '0':116 '0b1000000000000000':112 '0x00ff':131 '1':170 '10':52,158,165 '17':118 '74ahc595':14 '8':125 '9':49 'alreadi':189 'anyth':173 'assembl':208 'bin':111,124,130,167,169 'byte':120,122,126,128,146,156 'chain':8 'clk':89,143,153 'code':41,79 'control':20 'daisi':7 'data':84,140,150 'delay':164 'design':200 'digitalwrit':102,132,159 'en':95,106 'error':196 'esp32':23 'fine':74 'friend':2 'hey':1 'high':31,56,163 'i.imgur.com':12,58,62 'i.imgur.com/tzbq45e.png)':11 'i.imgur.com/v5ooe1k.png)':57 'i.imgur.com/vpmbdw3.png))':61 'idea':180 'input':110,123,129,166,168 'int':114 'issu':209 'latch':100,135,162 'lie':186 'look':191 'low':107,136 'lower':127,145 'm':175 'manufactur':202 'may':185 'msbfirst':144,154 'n':94,105 'next':39 'notic':211 'o':48,51 'one':28,71 'output':29,47,85,90,96,101 'pcb':205 'pinmod':81,86,91,97 'problem':184 'regist':10 'seem':42 'set':27,65 'shift':9,82,87,92,98,103,133,138,141,148,151,160 'shiftdataout':137,147 'short':193 'snip':80 'sourc':197 'stay':55 'switch':36 'time':34 'tri':190 'two':6 'uint16':108 'upper':121,155 'use':78 'usleep':157 've':188 'via':21 'want':25 'wherea':67 'work':44,73 'wrong':177 'www.diodes.com':16 'www.diodes.com/assets/datasheets/74ahc595.pdf))':15 'zoom':60"
+cross: false
+upVotes: 0
+downVotes: 0
+ranking: 1695910961
+visibility: "visible "
+apId: "https://discuss.tchncs.de/post/3882589"
+editedAt: DateTimeImmutable @1695842569 {#1858
date: 2023-09-27 21:22:49.0 +02:00
}
+createdAt: DateTimeImmutable @1695841461 {#2388
date: 2023-09-27 21:04:21.0 +02:00
}
}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4370
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4356
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4318
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: App\Entity\EntryComment {#4190
+user: App\Entity\User {#4203 …}
+entry: App\Entity\Entry {#2413}
+magazine: App\Entity\Magazine {#264}
+image: null
+parent: null
+root: null
+body: "Would it work if you made that delay 1000?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695882010 {#4185
date: 2023-09-28 08:20:10.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#4191 …}
+nested: Doctrine\ORM\PersistentCollection {#4193 …}
+votes: Doctrine\ORM\PersistentCollection {#4195 …}
+reports: Doctrine\ORM\PersistentCollection {#4197 …}
+favourites: Doctrine\ORM\PersistentCollection {#4199 …}
+notifications: Doctrine\ORM\PersistentCollection {#4201 …}
-id: 29957
-bodyTs: "'1000':9 'delay':8 'made':6 'work':3 'would':1"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857487"
+editedAt: null
+createdAt: DateTimeImmutable @1695868540 {#4186
date: 2023-09-28 04:35:40.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Also try upping the usleep call?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695868653 {#4316
date: 2023-09-28 04:37:33.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4319 …}
+nested: Doctrine\ORM\PersistentCollection {#4321 …}
+votes: Doctrine\ORM\PersistentCollection {#4323 …}
+reports: Doctrine\ORM\PersistentCollection {#4325 …}
+favourites: Doctrine\ORM\PersistentCollection {#4327 …}
+notifications: Doctrine\ORM\PersistentCollection {#4329 …}
-id: 29958
-bodyTs: "'also':1 'call':6 'tri':2 'up':3 'usleep':5"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857536"
+editedAt: null
+createdAt: DateTimeImmutable @1695868653 {#4317
date: 2023-09-28 04:37:33.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Hmmmm do you want to write to both shift register at the same time? I say this because you’re looping 16 times, but seem to be sending the high and low bytes out 16 times over rather than one bit each time, although you are shifting the input."
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869074 {#4353
date: 2023-09-28 04:44:34.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4357 …}
+nested: Doctrine\ORM\PersistentCollection {#4359 …}
+votes: Doctrine\ORM\PersistentCollection {#4361 …}
+reports: Doctrine\ORM\PersistentCollection {#4363 …}
+favourites: Doctrine\ORM\PersistentCollection {#4365 …}
+notifications: Doctrine\ORM\PersistentCollection {#4367 …}
-id: 29959
-bodyTs: "'16':22,35 'although':44 'bit':41 'byte':33 'high':30 'hmmmm':1 'input':49 'loop':21 'low':32 'one':40 'rather':38 're':20 'regist':10 'say':16 'seem':25 'send':28 'shift':9,47 'time':14,23,36,43 'want':4 'write':6"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857666"
+editedAt: DateTimeImmutable @1695869154 {#4354
date: 2023-09-28 04:45:54.0 +02:00
}
+createdAt: DateTimeImmutable @1695869074 {#4355
date: 2023-09-28 04:44:34.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Maybe I’m getting ahead of myself, but maybe try using digitalWrite for a single bit instead of shiftDataOut?"
+lang: "en"
+isAdult: false
+favouriteCount: 0
+score: 0
+lastActive: DateTime @1695869203 {#4375
date: 2023-09-28 04:46:43.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4378 …}
+nested: Doctrine\ORM\PersistentCollection {#4382 …}
+votes: Doctrine\ORM\PersistentCollection {#4384 …}
+reports: Doctrine\ORM\PersistentCollection {#4385 …}
+favourites: Doctrine\ORM\PersistentCollection {#4387 …}
+notifications: Doctrine\ORM\PersistentCollection {#4389 …}
-id: 29960
-bodyTs: "'ahead':5 'bit':16 'digitalwrit':12 'get':4 'instead':17 'm':3 'mayb':1,9 'shiftdataout':19 'singl':15 'tri':10 'use':11"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://lemmy.world/comment/3857706"
+editedAt: null
+createdAt: DateTimeImmutable @1695869203 {#4372
date: 2023-09-28 04:46:43.0 +02:00
}
}
+root: App\Entity\EntryComment {#4190}
+body: "Good idea, I’ve tried usleep after all lines, but no change…"
+lang: "en"
+isAdult: false
+favouriteCount: 1
+score: 0
+lastActive: DateTime @1695882009 {#4413
date: 2023-09-28 08:20:09.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@quiescentcurrent@discuss.tchncs.de"
"@mvirts@lemmy.world"
]
+children: Doctrine\ORM\PersistentCollection {#4416 …}
+nested: Doctrine\ORM\PersistentCollection {#4420 …}
+votes: Doctrine\ORM\PersistentCollection {#4422 …}
+reports: Doctrine\ORM\PersistentCollection {#4423 …}
+favourites: Doctrine\ORM\PersistentCollection {#4425 …}
+notifications: Doctrine\ORM\PersistentCollection {#4427 …}
-id: 29967
-bodyTs: "'chang':12 'good':1 'idea':2 'line':9 'tri':5 'usleep':6 've':4"
+ranking: 0
+commentCount: 0
+upVotes: 0
+downVotes: 0
+visibility: "visible "
+apId: "https://discuss.tchncs.de/comment/3318310"
+editedAt: null
+createdAt: DateTimeImmutable @1695882009 {#4410
date: 2023-09-28 08:20:09.0 +02:00
}
} |
|
Show voter details
|
65 |
DENIED
|
edit
|
App\Entity\Magazine {#264
+icon: Proxies\__CG__\App\Entity\Image {#245 …}
+name: "askelectronics@discuss.tchncs.de"
+title: "askelectronics"
+description: """
**For questions about component-level electronic circuits, tools and equipment.**\n
\n
Rules\n
-----\n
\n
1: Be nice.\n
\n
2: Be on-topic (eg: *Electronic*, not *electrical*).\n
\n
3: No commercial stuff, buying, selling or valuations.\n
\n
4: Be safe.\n
\n
---
"""
+rules: null
+subscriptionsCount: 1
+entryCount: 154
+entryCommentCount: 1230
+postCount: 1
+postCommentCount: 4
+isAdult: false
+customCss: null
+lastActive: DateTime @1729413608 {#274
date: 2024-10-20 10:40:08.0 +02:00
}
+markedForDeletionAt: null
+tags: null
+moderators: Doctrine\ORM\PersistentCollection {#236 …}
+ownershipRequests: Doctrine\ORM\PersistentCollection {#232 …}
+moderatorRequests: Doctrine\ORM\PersistentCollection {#221 …}
+entries: Doctrine\ORM\PersistentCollection {#179 …}
+posts: Doctrine\ORM\PersistentCollection {#137 …}
+subscriptions: Doctrine\ORM\PersistentCollection {#199 …}
+bans: Doctrine\ORM\PersistentCollection {#116 …}
+reports: Doctrine\ORM\PersistentCollection {#102 …}
+badges: Doctrine\ORM\PersistentCollection {#80 …}
+logs: Doctrine\ORM\PersistentCollection {#70 …}
+awards: Doctrine\ORM\PersistentCollection {#1360 …}
+categories: Doctrine\ORM\PersistentCollection {#1792 …}
-id: 11
+apId: "askelectronics@discuss.tchncs.de"
+apProfileId: "https://discuss.tchncs.de/c/askelectronics"
+apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
+apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
+apInboxUrl: "https://discuss.tchncs.de/inbox"
+apDomain: "discuss.tchncs.de"
+apPreferredUsername: "askelectronics"
+apDiscoverable: true
+apManuallyApprovesFollowers: null
+privateKey: null
+publicKey: null
+apFetchedAt: DateTime @1727247714 {#268
date: 2024-09-25 09:01:54.0 +02:00
}
+apDeletedAt: null
+apTimeoutAt: null
+visibility: "visible "
+createdAt: DateTimeImmutable @1687144409 {#270
date: 2023-06-19 05:13:29.0 +02:00
}
} |
|
Show voter details
|