Does this code look correct for writing a series of data value to the internal chip eprom, and if so, how do I continue the data on the 2nd & 3rd line.
It compiles with no errors but unable to add more data on a secound and 3rd line (commented out for now)
Using Ver 0.96.0 GCB compiler
Sorry, just a test to add attachments. For those who may wonder what my project is, it is using old crt displays to show analog style clock. Yes, i did buy a preprogramed kit, but now I want to learn GCB and thought this would be a good platform to learn on.
The ancient 2 inch crt is behide the breadboard.
You should be using GCB Ver .97. If .96 is a typo then disregard
Loopcounter is not used. However counters need to change, so
should be a variable rather than a constant. Use Dim for variables.
There is no need use variable indxadx to write the EEPROM
But I am guessing that later in code you will use it to "Read"
the EPPROM so I let it remain. I formatted EPWRITE for ease
of reading.
This is how I might do it ( Minus the Comments/corrections)
'start prgm list'''A most simple beginning for crt_drvr display'''------------------------------------------------------------------------''''''IntialprgmMarch32017'''PEH'''***************************************************************************;BeginingofCRTcontrolprgm;March42017;GreatCowBasicver097.0;;ChipSettings#Chip 16F1847, 32#Config OSC = INTOSC, MCLRE = OFF, WDTE = OFF#Option Explicitdimindxadxasbyte' variable dimDataCountasbyte' variable dimLoopCounterasByte' variable 'REM WMR If loopcounter is a variable do not use #define,' use DIM instead 'REM WMR #define LoopCounter ' ----- Configuration'' ----- Main body of program commences here.''First, setup eeprom memory with data''REM WMR indxadx = 0 'setintiallocation'REM WMR 'REM WMR epwrite indxadx, 1,23,253,12,23,122,211,90,1,2,3,4,77,66,55'REM WMR ;234,111,244,222,111,123,213'REM WMR ;77,32,253,1,2,3,4,5,45,77'*** Write EEPROM Data (16 per line for ease of formatting) ***' index 16 bytes of Data EPWRITE0,1,23,253,12,23,122,211,90,1,2,3,4,77,66,55,234EPWRITE16,111,244,222,111,123,213,77,32,253,1,2,3,4,5,45,77'EPWRITE 32, - - - - - - - 16 more - - - - - - - - - 'EPWRITE 48, - - - - - - - 16 more - - - - - - - - -
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Picaxe Basic has already "Dimmed" variables for the user. These are B0,B1, W5,W6 .etc. So when you use "Symbol" you are assigning an alternate name to to the already "dimmed" variable. "Symbol" is therefore much like #Define in GCB. Picaxe symbol doe not "dim" variables it simply assigns an Alias.
Great Cow Basic does not set aside user variables like B0,B1,B2, you must do this with "DIM" or remove "#option Explicit" and allow GCB to automatically dim upon usage in code.
Example:
Dim B0 as byte
Dim B1 as byte
#define Counter B0 '// Same as using Symbol in Picaxe Basic
#define index B1 '// Same as using Symbol in Picaxe Basic
But this is not really code efficient or necessary since we to not really need the B variables. Do this instead
Dim Counter as byte
Dim index as byte
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Great Cow Basic is extremely flexible. Let's say you want to use Picaxe B and W style variables Where W0 equates to B1:B0 ...
Dim W0 as Word
Dim B1 ALIAS W0_H as Byte 'High byte represented by _H
Dim B0 ALIAS W1 as Byte 'Low Byte
Test:
B0 = 0
B1 = 1
'// W0 is now = 256
W0 = 257
'// B0 is now = 1
'// B1 is now = 1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks William, that is just what I needed to get started (since it is the first thing the firmware needs to do). The 8 bit values in eprom will be read out in pairs to be applied to the x and y deflection plates (thru dual DAC and HV drivers). This is a project that I would call "Idon't need this, but it is fun and I will learn GCB".
.
You should be using GCB Ver .97. If .96 is a typo then disregard
Thanks William, you have been a tremendous help in getting to switch over to GCB. I just now updated to Ver .97, thanks for suggesting.
Last edit: Paul Haug 2017-03-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does this code look correct for writing a series of data value to the internal chip eprom, and if so, how do I continue the data on the 2nd & 3rd line.
It compiles with no errors but unable to add more data on a secound and 3rd line (commented out for now)
Using Ver 0.96.0 GCB compiler
Maybe I just need to add "epwrite indxadx" to the 2nd and 3rd line, but will that mess up the indxadx value or will it continue correctly.
Last edit: Paul Haug 2017-03-05
Sorry, just a test to add attachments. For those who may wonder what my project is, it is using old crt displays to show analog style clock. Yes, i did buy a preprogramed kit, but now I want to learn GCB and thought this would be a good platform to learn on.
The ancient 2 inch crt is behide the breadboard.
Last edit: Paul Haug 2017-03-05
Hi Pau,
My comments below.
You should be using GCB Ver .97. If .96 is a typo then disregard
Loopcounter is not used. However counters need to change, so
should be a variable rather than a constant. Use Dim for variables.
There is no need use variable indxadx to write the EEPROM
But I am guessing that later in code you will use it to "Read"
the EPPROM so I let it remain. I formatted EPWRITE for ease
of reading.
This is how I might do it ( Minus the Comments/corrections)
Maybe this will help with Dim vs #define .
Picaxe Basic has already "Dimmed" variables for the user. These are B0,B1, W5,W6 .etc. So when you use "Symbol" you are assigning an alternate name to to the already "dimmed" variable. "Symbol" is therefore much like #Define in GCB. Picaxe symbol doe not "dim" variables it simply assigns an Alias.
Great Cow Basic does not set aside user variables like B0,B1,B2, you must do this with "DIM" or remove "#option Explicit" and allow GCB to automatically dim upon usage in code.
Example:
But this is not really code efficient or necessary since we to not really need the B variables. Do this instead
Great Cow Basic is extremely flexible. Let's say you want to use Picaxe B and W style variables Where W0 equates to B1:B0 ...
Thanks William, that is just what I needed to get started (since it is the first thing the firmware needs to do). The 8 bit values in eprom will be read out in pairs to be applied to the x and y deflection plates (thru dual DAC and HV drivers). This is a project that I would call "Idon't need this, but it is fun and I will learn GCB".
.
Last edit: Paul Haug 2017-03-05