Go to advanced search

by BMardle
Fri Mar 06, 2020 2:11 pm
Forum: Wanted
Topic: Wanted: Raspberry Pi Zero W
Replies: 6
Views: 1293

Re: Wanted: Raspberry Pi Zero W

jamesh wrote:
Fri Mar 06, 2020 1:46 pm
There should be some arriving in stock soon - there's been a lot of demand* in the last few months which has left the channel a bit empty.
Hooray!
I was beginning to think there must be someone Out There who can't see a W without soldering a header onto it :)
by BMardle
Fri Mar 06, 2020 1:30 pm
Forum: Wanted
Topic: Wanted: Raspberry Pi Zero W
Replies: 6
Views: 1293

Wanted: Raspberry Pi Zero W

Does anyone know of anywhere in the UK that has a Pi Zero W? I've found plenty of sites that list them for about £9 but are out of stock. I want to add a colour-coded header to it. I've found someone selling the Pi Zero W with one already installed but it's £16, which seems a lot considering the hea...
by BMardle
Sat Dec 07, 2019 4:49 pm
Forum: Bare metal, Assembly language
Topic: BL instruction vs. basic blocks
Replies: 12
Views: 1187

Re: BL instruction vs. basic blocks

Sorry, but I don't understand the OP. It might help to know details of the language being compiled. Usually basic blocks, if used at all, are part of a control flow analysis. At that point a typical compiler has your program in some intermediate form, not in assembly. So the intermediate code might...
by BMardle
Tue Dec 03, 2019 3:44 pm
Forum: Bare metal, Assembly language
Topic: BL instruction vs. basic blocks
Replies: 12
Views: 1187

Re: BL instruction vs. basic blocks

That is called calling convention and since you are writing the assembler that is up to you You can see the GCC one https://wiki.osdev.org/Calling_Conventions As many compilers link to GCC c code they often just adopt GCC calling convention. It's interesting that lists R12 as a 'scratch' register.
by BMardle
Tue Dec 03, 2019 2:21 pm
Forum: Bare metal, Assembly language
Topic: BL instruction vs. basic blocks
Replies: 12
Views: 1187

Re: BL instruction vs. basic blocks

I can't work out what you mean the BL instruction is always going to branch it will NEVER execute the next instruction (it has no condition) I also don't understand the OP's reference to 'basic blocks' or what 'side-effects' of instructions are, why they are being tracked, why they need to be known...
by BMardle
Tue Dec 03, 2019 9:09 am
Forum: Bare metal, Assembly language
Topic: BL instruction vs. basic blocks
Replies: 12
Views: 1187

Re: BL instruction vs. basic blocks

All true, LdB. I meant that sooner or later LR will be copied back to PC and then the next instruction will be executed.
Thanks for reminding me about conditional instructions, though!
by BMardle
Sun Dec 01, 2019 3:59 pm
Forum: Bare metal, Assembly language
Topic: BL instruction vs. basic blocks
Replies: 12
Views: 1187

BL instruction vs. basic blocks

Hi, all. I'm back at trying to write a compiler targetted on ARM again (for amusement/masochism). I know basic blocks usually (by definition) end with a branch/jump (or if the next instruction is a branch target), but I'm wondering whether it'd be simpler for my compiler to regard BL as a not-a-bran...
by BMardle
Wed Apr 17, 2019 2:12 pm
Forum: Troubleshooting
Topic: Environment variables vs. bash and lxterminal
Replies: 2
Views: 397

Re: Environment variables vs. bash and lxterminal

You cannot rely on access times. Many distros and images mount filesystems with the "noatime" or "relatime" options by default. Especially on an SD card, where small writes are costly, frequent access time updates could impact performance in many workloads. Thanks, jojopi. I thought it might be som...
by BMardle
Wed Apr 17, 2019 12:37 pm
Forum: Troubleshooting
Topic: Environment variables vs. bash and lxterminal
Replies: 2
Views: 397

Environment variables vs. bash and lxterminal

Hi, all. I recently tried to run 1 of my 'old' OpenGL/ES programs on my Pi 2 (Stretch). It didn't work because LD_LIBRARY_PATH wasn't set. I've put "export LD_LIBRARY_PATH=/vc/opt/lib" (or something similar!) in ~/.bash_profile. When I first log in (using the text console, not X), LD_LIBRARY_PATH is...
by BMardle
Wed Apr 03, 2019 12:18 pm
Forum: The MagPi
Topic: Help with Issue 71, 'Getting Started With Pygame Zero', pp52-57
Replies: 2
Views: 5212

Re: Help with Issue 71, 'Getting Started With Pygame Zero', pp52-57

I've largely solved the problem. It was the checks on whether the car had collided with the barriers that was the main culprit. Once I changed the code so it only checked for collisions with barriers on the screen, the frame rate at the end of the game went up from 11fps to 50fps! This makes me wond...
by BMardle
Sun Mar 31, 2019 8:07 pm
Forum: The MagPi
Topic: Help with Issue 71, 'Getting Started With Pygame Zero', pp52-57
Replies: 2
Views: 5212

Help with Issue 71, 'Getting Started With Pygame Zero', pp52-57

Hello, everyone. I've been reading the article on Pygame Zero in issue 71, which describes how to make a very simple driving game. It works fine under Windows 7, taking about 40 seconds to win a game, but on my Raspberry Pi 2 the game gets slower and slower as it runs, taking about 114 seconds to wi...
by BMardle
Thu Dec 20, 2018 11:58 am
Forum: C/C++
Topic: math problems in C
Replies: 12
Views: 3899

Re: math problems in C

Hi, Killertechno.
I expect your '200's are actually a teensy bit smaller. Casting a floating-point number to an int truncates it. Try adding 0.5 then casting.
by BMardle
Sat Aug 25, 2018 4:08 pm
Forum: Troubleshooting
Topic: lxterm unreadable after upgrading Jessie to Stretch
Replies: 1
Views: 274

Re: lxterm unreadable after upgrading Jessie to Stretch

Oh... Emacs looks the same as it did under Jessie, if that helps narrow things down.
by BMardle
Sat Aug 25, 2018 4:07 pm
Forum: Troubleshooting
Topic: lxterm unreadable after upgrading Jessie to Stretch
Replies: 1
Views: 274

lxterm unreadable after upgrading Jessie to Stretch

Hi, everyone. I recently upgrading from Jessie to Stretch on my Pi 2. Now I can't read what lxterm says. At first I thought it was displaying text in a constant grey on a white background. After zooming in, I can see that it's using lots of different shades of grey and even the occasional black pixe...
by BMardle
Fri May 11, 2018 5:16 pm
Forum: C/C++
Topic: CPU load on computer
Replies: 9
Views: 3190

Re: CPU load on computer

Very useful thread! I'm trying much the same thing (displaying processor load on an LED bargraph). At the moment I'm reading /proc/stat once a second and displaying the change in (system time + user time)/CLK_TCK. I'm not sure that's actually right... but it does seem to bear some resemblance to wha...
by BMardle
Wed Feb 28, 2018 1:15 pm
Forum: The MagPi
Topic: MagPi67: Pi in Spectrum case: diodes on 'address' lines
Replies: 9
Views: 3444

Re: MagPi67: Pi in Spectrum case: diodes on 'address' lines

The diodes are needed, as noted, if the rows are always driven high and low, are a necessity to avoid damage, and I think that's why they are there. Looking at the source code will show how the author implemented their scan routine, whether it mandates diodes or not. Indeed. My first paying job was...
by BMardle
Mon Feb 26, 2018 9:26 am
Forum: The MagPi
Topic: MagPi67: Pi in Spectrum case: diodes on 'address' lines
Replies: 9
Views: 3444

Re: MagPi67: Pi in Spectrum case: diodes on 'address' lines

Although... with the keyboard plugged in, if you press 2 keys on the same address line at the same time, that shorts together 2 of the 'data' GPIOs. So, by the same logic, you should have diodes on those lines too ;)
by BMardle
Mon Feb 26, 2018 9:04 am
Forum: The MagPi
Topic: MagPi67: Pi in Spectrum case: diodes on 'address' lines
Replies: 9
Views: 3444

Re: MagPi67: Pi in Spectrum case: diodes on 'address' lines

PiGraham wrote:
Mon Feb 26, 2018 7:59 am
The diodes are not essential but they seem to me to be a reasonable safety measure.
OK. You've convinced me. :D
by BMardle
Sun Feb 25, 2018 9:57 pm
Forum: The MagPi
Topic: MagPi67: Pi in Spectrum case: diodes on 'address' lines
Replies: 9
Views: 3444

Re: MagPi67: Pi in Spectrum case: diodes on 'address' lines

Are the diodes you mention a legacy of the Spectrum or part of the Pi interface? Part of the Pi interface. Effectively they're converting totem-pole outputs to open-drain ones... but you can effectively program the GPIOs to be open-drain outputs. Admittedly, adding the diode removes the possibility...
by BMardle
Sun Feb 25, 2018 6:44 pm
Forum: The MagPi
Topic: MagPi67: Pi in Spectrum case: diodes on 'address' lines
Replies: 9
Views: 3444

MagPi67: Pi in Spectrum case: diodes on 'address' lines

Hi, all. The project in MagPi 67 to put a Pi in a ZX Spectrum case sounds fun. (Unfortunately, the keyboard is the only part of my venerable Speccy that doesn't work; though my Interface 1 is duff too :roll: ) I'm a little baffled as to why there are diodes on the 'address' lines connected to the ke...
by BMardle
Wed Feb 14, 2018 12:42 pm
Forum: Troubleshooting
Topic: Synaptic Package Manager - no background
Replies: 4
Views: 1231

Re: Synaptic Package Manager - no background

Ah-ha! Problem solved. I've give y'all the long version, since I'm not sure which bits of my solution are necessary. I went to Start menu -> Preferences -> Appearance Settings -> Menu Bar, changed the foreground colour to red, clicked 'OK'. Nothing happened. Clicked 'Defaults'. Again, nothing seemed...
by BMardle
Sun Feb 11, 2018 5:42 pm
Forum: Troubleshooting
Topic: Synaptic Package Manager - no background
Replies: 4
Views: 1231

Re: Synaptic Package Manager - no background

I've got the same(?) problem as Mojorizing. Tried deleting /root/.synaptic and rebooting. The only noticeable effect was to change the size of the synaptic window. The colours were the same (barely useable). Any other suggestions apart from re-installing the OS? (For what it's worth, some of the thi...
by BMardle
Sat Oct 07, 2017 3:04 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GY-521 I2C not detected on Pi
Replies: 15
Views: 5897

Re: GY-521 I2C not detected on Pi

It's a combination of luck and tolerances. The Slice of PI/O has a jumper that selects 3.3V or 5V for its MCP23017's Vdd, and the I2C lines are connected straight to the Pi's. Oh, well. There must be a lot of luck about :D My PIC is now running off 3.3V (despite being connected to a 5V LCD, which s...
by BMardle
Wed Oct 04, 2017 6:45 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GY-521 I2C not detected on Pi
Replies: 15
Views: 5897

Re: GY-521 I2C not detected on Pi

So why do my MCP23017s running with Vcc @ 5V work OK? That's a good question, since the MCP23017 data sheet says SCL and SDA in, high, has to be at least 0.8*Vdd! I use a couple of them at 5V in a memory-programmer connected to my Pi 1B. (I'm planning to get my Pi Zero talking to a PIC soon. I know...
by BMardle
Fri Aug 11, 2017 10:47 am
Forum: Off topic discussion
Topic: armsvc.exe :-)
Replies: 4
Views: 1756

Re: armsvc.exe :-)

rpiboy wrote:
Fri Aug 11, 2017 1:24 am
It's a virus. :shock:
https://forums.adobe.com/thread/2311615
I think that page says AVG was erroneously claiming it as a virus.

Go to advanced search