• ### Recent Forum Posts

#### Re: Calculate tuning value for the AD9850 DDS.

Here it is. It wasn't tested...

ftw var long ; unsigned long ftw; // 32-bit Frequency Tuning Word
f var long

;/************************************************************************
;...

pedja089 Yesterday, 23:33

#### Re: Confused by Arraywrite

mikes quote here is very wrong

from the manual

the inflexible way

richard Yesterday, 23:15

for control = 0 to 15
LATB.4=Control.0
LATB.5=Control.1
LATB.6=Control.2
LATB.7=Control.3
next control

pedja089 Yesterday, 22:20

Yes thanks, but how to step through the options in the most efficient way without disturbing ports B0-3

retepsnikrep Yesterday, 21:26

#### Re: Calculate tuning value for the AD9850 DDS.

Yes, in XC8 that's how you would address the "local" variables (c, f, and n) using assembly language.

Mike, K8LH Yesterday, 21:10

#### Re: Confused by Arraywrite

The ARRAYWRITE command prepends the LOOKUP or LOOKDOWN commands.

b0 VAR BYTE
b1 VAR BYTE
Letter VAR BYTE[9]
ARRAYWRITE Letter, ["SOMETHING"]
FOR b0 = 0 TO 8
LOOKUP b0, [Letter], b1

mpgmike Yesterday, 18:14

#### Confused by Arraywrite

I've looked at the examples and posts on here and they are helpful but.....

OK I have a 38x25 display.
I can talk to it using hserout and have a 1ms interrupt running so want to send it 1...

retepsnikrep Yesterday, 15:52

#### Re: Calculate tuning value for the AD9850 DDS.

Mike,
It can be almost copy/paste in PBP. I can try to sort details to work in PBP. But I don't understand what is calcFTW@c,@f,@n... Is it just variables declared in function?
Can you explain?

pedja089 Yesterday, 09:12

If you are using PIC 18F, then use simplest solution is
LATB.4=Control.0
LATB.5=Control.1
LATB.6=Control.2
LATB.7=Control.3

EDIT:
For PIC16

PortBCopy var byte

pedja089 Yesterday, 09:01

I have a HTC4067 16x1 multiplexer, it's controlled by four lines S0, S1, S2, S3
I have these all connected to Port B pins 4,5,6,7 respectively on my pic. This could be reversed to 7,6,5,4 if that...

retepsnikrep Yesterday, 08:24
• # Features

PICBASIC PRO™ Compiler 3.0
• Familiar BASIC syntax
• IF (condition) THEN / ELSE / ELSEIF /ENDIF
• SELECT CASE
• FOR… NEXT
• DO WHILE/UNTIL
• Direct Register Access
• All Special Function Registers are pre-mapped by PBP and accessible by name
• Built-In Commands for operations common to embedded development
• Accurate Delays in uS and mS resolutions
• Analog to Digital Conversion
• Asynchronous Serial Communications (RS-232, RS-485, etc)
• Synchronous Serial including I2C and SPI
• Character LCD
• PWM
• USB
• Parsing and Formatting of ASCII Strings
• Sinusoidal Frequency Generation and DTMF (requires hardware filtering)
• Pulse-Width Measurement
• Low-Power Mode
• Conditional Compilation with Command-Line Constants
• In-Line Assembly Language
• Easy Device Configuration
• Configuration settings listed for each supported device
• New #CONFIG directive eliminates the need to edit header files
• Interrupts in BASIC or Assembly Language
• Newly revised and expanded, 300+ page reference manual.
• MPLAB/MPLABX compatible.
• Technical Support via Telephone, Email, and Community Forum (phone and email support not available for Experimenter Edition.)