Compatible MSP430 and Arduino NTSC programs for the VS23S010 Breakout Board

Designing hardware and software that uses the VS23S0X0 family of ICs as a 8-bit or SPI SRAM memory or as a Video Controller for generating Composite Video (TV-Out) or driving other kinds of displays.
Post Reply
VLSI Staff
Posts: 17
Joined: Tue 2017-06-06 8:59

Compatible MSP430 and Arduino NTSC programs for the VS23S010 Breakout Board

Post by Kalle » Wed 2017-09-20 13:35

The individual Arduino and MSP430 versions of the VS23S010 NTSC test image generation have been posted on the forum previously. However, the two older programs aren't compatible with each other. If you try to run a Breakout Board which MSP430 has been programmed with the ntsc_msp430, with an Arduino that is running the ntsc_uno, you will easily run into problems. Note that as the older Arduino post mentions, you should not connect 5 volt signals to the Breakout Board.

With the two new programs in this post, the responsibilities of the two boards are changed, so that they no longer interfere with each other. Basically what both of the two older programs did before, such as different initializations and setting indexes and prototype lines, is now the responsibility of the MSP430. The end result of this is the same test image as with the previous programs. While the MSP430 is running, the Arduino waits in a loop. Once the MSP finishes, it will signal the Arduino by setting the XCS, MOSI and MISO signals to a high output. The Arduino will recognize this and exit the loop. It will then enable the reset for the MSP430, and the Arduino can be used for further operations safely. In its current state, the Arduino program will draw the additional rectangle which can be seen at the bottom of the image.

IMG_20170908_160152_1.png (18.04 MiB) Viewed 220 times
As usual, the camera causes effects that would not be visible to human eye.

The only changes to the MSP430 program are the three lines below, which have been added to the end of ntsc.c. These work as a signal to Arduino.

Code: Select all

USICTL0 |= USISWRST; // Disable the USI module (used for SPI) with software reset
P1OUT |= 0xB << 4; // XCS, MOSI and MISO to output mode
P1DIR |= 0xB << 4; // Set the outputs high
The Arduino program has been changed a bit more. It still has the same vs23s010.cpp, spisimple.h, spisimple.cpp and ntsc.h files, but the setup-function of the main has been expanded to add the previously explained waiting functionality.

Code: Select all

void setup() {

  // MSP430 reset disabled
  pinMode(8, OUTPUT);
  digitalWrite(8, HIGH);  
  // VS23 reset disabled
  pinMode(9, OUTPUT);
  digitalWrite(9, HIGH);  

  // Set XCS, MOSI, MISO and SCLK to input mode
  pinMode(10, INPUT);
  pinMode(11, INPUT);
  pinMode(12, INPUT);

  // Wait until the pins are all high
  while ( !( digitalRead(10) && 
             digitalRead(11) && 
             digitalRead(12) ) );
  // Enable MSP430 reset
  pinMode(8, OUTPUT);
  digitalWrite(8, LOW);


void loop() {
  // put your main code here, to run repeatedly:

The SpiRamVideoInit-function of the ntsc.cpp has been cleared of its old VS23 operations, since the MSP430 takes care of those, and instead only the Arduino's own SPI initialization function is called, along with whatever VS23 operations are wanted. The posted version includes the one FilledRectangle call, and it also prints the current line value to the PC serial connection.

Code: Select all

void SpiRamVideoInit() {
  // Initialize SPI and and check the VS23 ID

  FilledRectangle(144, 165, 176, 195, 165);

  Serial.print("Current line: 0x");
  Serial.println(SpiRW(CURLINE, 0, 0, 1), HEX);
It's still possible to run the Breakout Board on it's own with the updated program, since none of the VS23 operations have been changed. The new programs are available for download below. If need help with uploading them to your devices, or connecting the Breakout Board to an Arduino, see the two older forum posts for instructions.
MSP430 CCS project
(169.2 KiB) Downloaded 10 times
Arduino sketch
(6.71 KiB) Downloaded 11 times

Post Reply