Hello, I found some information about the POKE command:
'This program will set all of the PORTB pins high
POKE (6, 255)
The previous POKE command will set all pins as high.
Does anyone have more detailed information about the POKE command ?
I want to set individual pins on PORTB as high or low.
The goal is to output BCD data.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please disregard my previous question, I have found the answer.
After consultation with the data sheet for the 16F628A, I have
found the address and bit information for PORTB. A decimal
value of 255 in the command PEEK 6, 255 will make all ports high.
A decimal value of 0 will make all ports low. Any other decimal
value will produce a differant BCD pattern. Forgive my ignorance.
I am an absolute beginner !
Sean
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In GCBASIC PORTA, PORTB, etc are all treated as normal variables. If you need to output a particular value on a port, you can do it like this:
PORTB = 255
or
PORTB = b'00110101'
This will run faster than the Poke command, and is easier to read. The Poke command is mainly intended for clearing large blocks of memory inside of some loop.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, I found some information about the POKE command:
'This program will set all of the PORTB pins high
POKE (6, 255)
The previous POKE command will set all pins as high.
Does anyone have more detailed information about the POKE command ?
I want to set individual pins on PORTB as high or low.
The goal is to output BCD data.
Please disregard my previous question, I have found the answer.
After consultation with the data sheet for the 16F628A, I have
found the address and bit information for PORTB. A decimal
value of 255 in the command PEEK 6, 255 will make all ports high.
A decimal value of 0 will make all ports low. Any other decimal
value will produce a differant BCD pattern. Forgive my ignorance.
I am an absolute beginner !
Sean
In GCBASIC PORTA, PORTB, etc are all treated as normal variables. If you need to output a particular value on a port, you can do it like this:
PORTB = 255
or
PORTB = b'00110101'
This will run faster than the Poke command, and is easier to read. The Poke command is mainly intended for clearing large blocks of memory inside of some loop.