This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hi folks,
I've recently modified some Arduino code to run on the BBC micro:bit. One thing i have found is that the board does not have a lot of memory, so I have chopped some VGM arrays down to size which means they stop abruptly, leaving the PSG buzzing merrily.
The code I have based mine on has a 'silence' subroutine (below), but I guess that its ability to work depends on where the VGM data has been truncated - I have tried to ensure this is after a command sequence has been completed, but perhaps not successfully and so I am wondering whether anyone has some bulletproof coding for shutting up the PSG? Is there a byte sequence to get the chip ready to accept the silence sequence?
Code:
void PutByte (uint8_t b)
// Write data to the shift register via SPI interface
{
cs = 1;
spi.write(b);
cs = 0;
}
void SendByte(uint8_t b)
{
PSG_WE = 1;
PutByte(b);
PSG_WE = 0;
wait_us(SampleTime);
PSG_WE = 1;
}
void SilenceAllChannels()
{
SendByte(0x9f);
SendByte(0xbf);
SendByte(0xdf);
SendByte(0xff);
}
Subreddit
Post Details
- Posted
- 6 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/chiptunes/c...