Skip to content

Useage of PROGMEM without pgm_read_xxx_xxx #1

@ryan4volts

Description

@ryan4volts

First off, excellent library, got me quick started with the board. I am still yet to "truly" work through the IC and its capabailities though and come to terms with whta I am actually looking at.

After playing around with your code and using a logic analyser, I found that beacuse you have stored all your const variables in PROGMEM, that the avr also requires a specific program memory read useage as well. In this case a good example is provided on
https://www.arduino.cc/reference/en/language/variables/utilities/progmem/

When doing the following line for instance:
statusValue = AD5934byteWrite(START_FREQUENCY_REGISTER[n], frequencyCode(freqInHz, n));
START_FREQUENCY_REGISTER is actually defrences as {0x04, 0x32, 0x00} instead of the intended {0x82, 0x83 and 0x84}.

A quick solution would be to remove the PROGMEM defitinitions entirely from, the header. Though a more long term solution is to use the painful API and use pgm_read_xxx_xxx everywhere through the app.

ACTUAL READ
image

Intended
image

Keep up the good work!
Ryan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions