Skip to content

guntars-lemps/fg3pico

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fg3pico is 3 channels frequency generator based on Raspberry Pi Pico 2, it should be compatible with any RP3250 board (but not tested). It can be used for various purposes, for example, it can drive 3 phase motors or can be used for 3 phase AC generation

Features

  • Frequency outputs are digital, the pins used for output are GP2, GP3, GP4
  • Generator is driven by UART commads. UART pins used are default GP0 and GP1
  • UART over USB can be used. It automatically switches over to USB when USB host is connected
  • Each frequency has startup delay, 'on' period and 'off' period adjustable parameters. Also generation can be turned off independently for each channel
  • Frequency parameters can be stored in on-board flash memory and loaded from flash.
  • At board power-up it checks if there are frequencies stored. They are loaded from flash memory and generation starts automatically, no need to connect and setup by UART

Capabilities

Thanks to rp2350 pio features this board has excellent capabilities

  • Min timing units 3
  • Max timing units 4294967295
  • CPU ticks per one time unit 1
  • CPU ticks per one second 200000000

So this device has 5ns resolution per one unit. Max frequency it is able to generate is 33 MHz

UART commands

Each command contains additional CRC bytes at the end. The checksum algorithm used is CRC16/MODBUS.
The UART speed is 19200 bps. All values use big endian byte ordering (highest byte comes first)

  • Command 01 - SET FREQUENCIES
    if ON period equals to 0 then frequency is muted (off)
    Command contains 39 bytes. F1, F2, F3 - three frequencies

    Command 0x01
    DELAY for F1 32 bit value
    ON period for F1 32 bit value
    OFF period for F1 32 bit value
    DELAY for F2 32 bit value
    ON period for F2 32 bit value
    OFF period for F2 32 bit value
    DELAY for F3 32 bit value
    ON period for F3 32 bit value
    OFF period for F3 32 bit value
    CRC16 Checksum 16 bits
  • Command 02 - STORE TO FLASH
    Stores current frequencies in flash memory

    0x02 0x81 0x3E
  • Command 03 - LOAD FROM FLASH
    Loads frequencies from the flash, this is done also at the reset (startup)

    0x03 0x41 0xFF
  • Command 04 - CHECK CAPABILITIES
    Request device capabilities (timing range, ticks per one unit, cpu ticks per second)

    0x04 0x83 0xBE
  • Possible device responses:

    OK, COMMAND EXECUTED

    0x00CRC checksum 16 bits

    BAD COMMAND (CRC ERROR)

    0x01CRC checksum 16 bits

    BAD DATA IN FLASH (CRC ERROR)

    0x02CRC checksum 16 bits

    CAPABILITIES (Response to command 04)

    Command0x04
    Min units 30x000x000x000x03
    Max units 42949672950xff0xff0xff0xff
    Ticks per one unit 10x000x000x000x01
    CPU ticks per one second 2000000000x0b0xeb0xc20x00
    CRC 16 bitsCRC high byteCRC low byte

About

Frequency generator based on Raspberry Pi Pico 2

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors