Write / read data from ram memory

Con-voy

New Member
Hello all
I'm a beginner in working with PICAXE microcontrollers, and I'm asking for help to solve the following problem:
I'm working on a project with PICAXE 40X2 and I want to get pulse-duration / pause sequences with different frequencies: 1hz-2hz-4hz ---- 25hz in ascending / descending succession etc. For this I need a lot of data
To obtain the duration / pause of this pulse sequence and I do not know how to write / write this data into ram memory available on the chip, and these data can be used during the program run automatically (to reduce the number of program lines). Beginners use Logicator picaxe, but I can also insert "basic" instructions. For example, I build a general shema Lader High 0, Wait "A", Low 0, Wait "B", etc. that automatically run with other values for variable A and B, read from Ram's memory, to the next cycle.
Thank you very much
 

hippy

Technical Support
Staff member
Welcome to the PICAXE forum.

Logicator may not be the best choice for what you want to do. If you are having to revert to using BASIC cells it may be better to use the textual Basic programming language. If ultimately for students to use in Logicator you can use Basic programming to do develop what you need then move that into Logicator later.

To access data in RAM, "GET indexVariable, WORD wordVariable" may be what you need to use
 

Con-voy

New Member
Thank you very much
I'll try to understand better what to do with the manual.
It would still help me with a small example.
Regards
 

hippy

Technical Support
Staff member
You can simulate this within PE6 which demonstrates using scratchpad to hold word variables and being able to read those -
Code:
#Picaxe 20X2
#Terminal 9600

Symbol indexVariable = w1
Symbol wordVariable  = w2

indexVariable = 20
wordVariable  = 12345
Put indexVariable, Word wordVariable

SerTxd( "1) wordVariable value = ", #wordVariable, CR, LF )

wordvariable = 0

SerTxd( "2) wordVariable value = ", #wordVariable, CR, LF )

indexVariable = 20
Get indexVariable, Word wordVariable

SerTxd( "3) wordVariable value = ", #wordVariable, CR, LF )
GET/PUT will access Scratchpad, PEEK/POKE will access RAM. When accessing RAM one needs to be careful to avoid the 'b' and 'w' variables which share that RAM.
 
Top