Jump to content
  • 0

AD2 - Sending numbers from 0 to 255 as serial counting?


Jurek

Question

I would like to send a sequence of numbers in binary code as a serial stream from 0-255. How can I do this in AD2? From what I see, I can use the BUS for parallel transmission of a counter, but I want to do it serially to control the SCL pin of the EEPROM 24C02. I don't want to use SPI.

Thanks Jurek

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hi @Jurek,

Unless I am mistaken, if you are wanting to send out a counter serially over just one pin, you will need to create a custom pattern for it.

This can either be done in app with a custom output on one of the digital pins (I would recommend using some sort of external program to create the list of 0's and 1's that can then be copy pasted into the table), though you will need to select a different AD2 configuration from the WaveForms Device Manager as the default configuration only allocates 1 ki Samples to the custom pattern, which will not be enough samples for 255 8-bit messages.

Alternatively you can do this with WaveForms SDK and let something like Python create and control the output, similar to how is done in DigitalOut_Custom.py.
WaveForms SDK location.png

Let me know if you have any questions.

Thanks,
JColvin

Link to comment
Share on other sites

  • 0
9 hours ago, JColvin said:

Hi @Jurek,

Unless I am mistaken, if you are wanting to send out a counter serially over just one pin, you will need to create a custom pattern for it.

This can either be done in app with a custom output on one of the digital pins (I would recommend using some sort of external program to create the list of 0's and 1's that can then be copy pasted into the table), though you will need to select a different AD2 configuration from the WaveForms Device Manager as the default configuration only allocates 1 ki Samples to the custom pattern, which will not be enough samples for 255 8-bit messages.

Alternatively you can do this with WaveForms SDK and let something like Python create and control the output, similar to how is done in DigitalOut_Custom.py.
WaveForms SDK location.png

Let me know if you have any questions.

Thanks,
JColvin

Hi JClovin,

Thanks for the tip. I have imported a binary file with 256 binary words into the custom pattern window. Have ended with this. I'm not sure what you mean by a "different AD2 configuration" - I assume you meant a startup dialog window, right? 

Screenshot 2024-08-23 at 09.48.34.png

Link to comment
Share on other sites

  • 0
33 minutes ago, attila said:

Hi @Jurek

You could use the Protocol/I2C/Custom or the Script tool or WF SDK to program the EEPROM.

Yes, will try that as well. So can I just load a steram 0 and 1 as a script in the Custom I2C pattern?

Thanks.

Link to comment
Share on other sites

  • 0

Hi @Jurek,

Yes, the different configuration is available when you first open WaveForms and select your device within the WaveForms Device Manager. There are numbered options below that allocate different amounts of the built-in device memory to different analog/digital systems.

image.png

Newer devices, such as the Analog Discovery 3, have more built in memory so you don't end up limiting the data storage quite so much when choosing different configurations. Other devices with DDR memory (like the ADP2xxx and ADP3xxx) help with this even further.

image.png

Let me know if you have any questions.

Thanks,
JColvin

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...