Examples | Shop
 
OOPicII+™ and SCP
Accessing Program EEPROM Memory


 
This example application demonstrates how a DS-IM Interface Module can be used with an OOPicII+ to serial access the OOPics EEProm memory using Serial Control Protocol (SCP). This example requires no OOPic code downloaded from the compiler as the code is sent serially using SCP. This example is taken from the OOPic Programmers Guide, Chapter 16.

Connections

Using a 40 pin-40 pin IDC ribbon cable (part of the 2 module fixing kit), connect the OOPicII+ 40 pin header to the outer most 40 pin header on the DS-IM. The inner 40-pin header is used for IO connections and is connected to the other 40-pin header.

The LED is connected to the inner 40-pin header on the DS-IM as follows:

The leg that is closest to the flat edge of the LED is connected to Gnd.

The positive leg is connected to the designated pin on the DS-IM via a 1K resistor. This resistor is needed other wise the LED will blow.


LED - Flat Edge Leg to Gnd - Positive Leg to 1K resistor to Pin 19

The DS-IM can be mounted above the OOPicII+ using the spacers in the 2 module fixing kit.

The serial cable is connected via a female to male gender changer to the DS-IM’s DB9F connector.


Writing to the EEProm

*This example writes the following program to the OOPicII+’s EEProm using SCP.

Dim R As New oDio1

Sub Main()
R.ioline = 7
R.direction = cvoutput
Do
R = OOPic.HZ1
Loop
End Sub


The following code can be written to comm. Port 1 using the direct_to_com1.ht.

Send "\0V", Receive "v"
Send "X", Receive "s" (The OOPic is now reset and the program is stopped.)
Send "0J", Receive "j"
Send "67H", Receive "h"
Send "80L", Receive "l"
Send "0B802901N", Receive "s"
Send "01098789N", Receive "s"
Send "001D8900N", Receive "s"
Send "0E810729N", Receive "s"
Send "B90029BEN", Receive "s"
Send "28CE29B0N", Receive "s"
Send "89001481N", Receive "s"
Send "8189001DN", Receive "s"
Send "8100FFFFN", Receive "s"
Send "W"

Note that no command response code was received after the Reset Command and that after the reset, the OOPic is no longer in Serial Control Mode.

It is possible to write data into the EEPROM without resetting the OOPic. When doing so, care must be taken not to overwrite the program currently being executed.

The program created by the data above results in the LED flashing on for 1 second and off for one second.

*Taken from the OOPic Programmers Guide, Chapter 16, Serial Control Protocol (SCP).


Examples | Shop