I did get some time up with the assembler language, and as far as im concerned, after getting Proton+ by crownhill **broken link removed** i'll never look back. The only downfall that I can perceive at the moment is the loss of counting cycles/pin changes over time periods while still performing other functions. It can still be done via
Variable = COUNTER Pin , Period
But you loose the ability to perform other functions at the same time. You can if you so desire build the interrupt routines, but hey, what makes up for it is the unbelievable in comparison math functions. you simple scan the port for 100ms or less, and do some math to scale the result. Sure it depends on you application, but for some of mine(digital tacho/baud tester) its suffice. Proton+ has complete support for 8/16/32 bit math operators, and its dead easy, eg
Dim Var1 as byte 'create an 8 bit variable
Dim Var2 as word 'create an 8 bit variable
Dim Var3 as dword 'create an 8 bit variable
Dim Result as dword
var1=10 'throw some data in them
var2=1000
var3=10000000
result = var3 / var2 * var1
print at 1,1, "Answer: ", result 'throw it up on an lcd
SEROUT PORTA.0 , T9600 , ["AZ", dec result,"M"] 'send it via 9600 baud
'********************************************************
For serial data receiving its as simple as:
SERIN PORTA.1 , T9600, 50, Time_Out,[wait("AZ"),dec result]
.
.
.
Time_Out:
'This is where it will end up should no data be recived within 50ms
'********************************************************
Theres a complete help file that breaks down every command, and gives examples on how to use every command.
It blew my mind when i could control a matrix keypad, 433Mhz Tx/Rx, and an LCD with pins to spare with only 2 pic micros, and the code is dead simple.. eg:
transmitter code:
Dim Variable as byte
Main:
Variable = INKEY 'If no key is pressed, the value returned is 16.
If Variable=16 then
Goto Main
Else
Variable=Variable+1 'Increment it as the value is 0-15 for key press
'but actual input is 1 - 16 for a 3*4 keypad
SEROUT PORTA.0 , T2400 , ["AZ", dec Variable,"M"] 'send it via 2400
'as my RF unit only supports upto 3K baud
End If
Delayms 20 'debounce for the keypad
goto Main
Reciever Code:
Dim Variable as byte
Main:
SERIN PORTA.1 , t2400, 80 , Time_Out,[wait("AZ"),dec Variable]
Print at 1,1, "Key Pressed:", Variable," "
Goto Main
Time_Out:
Goto Main
How easy is that.. just imagine the same simplicity with A/D conversions, graphics lcd interfacing the following math operators:
Addition '+'. Adds variables and/or constants.
Subtraction '-'. Subtracts variables and/or constants.
Multiply '*'. Multiplies variables and/or constants.
Multiply HIGH '**'. Returns the high 16 bits of the 16-bit multiply result.
Multiply MIDDLE '*/'. Returns the middle 16 bits of the 16-bit multiply result.
Divide '/'. Divides variables and/or constants.
Modulus '//'. Returns the remainder left after dividing one value by another.
Bitwise AND '&'. Returns the bitwise AND of two values.
Bitwise OR '|'. Returns the bitwise OR of two values.
Bitwise XOR '^'. Returns the bitwise XOR of two values.
Bitwise SHIFT LEFT '<<'. Shifts the bits of a value left a specified number of places.
Bitwise SHIFT RIGHT '>>'. Shifts the bits of a value right a specified number of places.
ABS. Returns the absolute value of a number.
ACOS Returns the ARC COSINE of a value in RADIANS.
ASIN Returns the ARC SINE of a value in RADIANS.
ATAN Returns the ARC TANGENT of a value in RADIANS.
COS. Returns the COSINE of a value in RADIANS.
DCD. 2 n -power decoder of a four-bit value.
DIG. Returns the specified decimal digit of a positive value.
LOG Returns the NATURAL LOG of a value.
LOG10 Returns the LOG of a value.
MAX. Returns the maximum of two numbers.
MIN. Returns the minimum of two numbers.
NCD. Priority encoder of a 16-bit value.
REV. Reverses the order of the lowest bits in a value.
SIN. Returns the SINE of a value in RADIANS.
SQR. Returns the SQUARE ROOT of a value.
TAN
copy and paste ftw
One difference that I did find between PICBASIC PRO and Proton+ is this:
PICBASIC Pro bit setting/clearing with a variable:
porta.0[Variable] = 1 'sets bit(variable) of porta
porta.0[Variable] = 0 'clears bit(variable) of porta
Proton+ :
doesn’t work..
If someone knows how to over come this - PLEASE let me know