Poor man signal generator

Photo by TE LUN OU YANG on Unsplash

In the world of electronics and microcontrollers, Abacuc is slowly but surely making its way. With meticulous precision, the task at hand involves the intricate implementation of 6522 logic into its framework. Abacuc has delved deep into the 6522 datasheet, scouring its contents for understanding. However, some sections of the datasheet have proven to be enigmatic, leaving Abacuc with more questions than answers.

In a quest for clarity and practicality, Abacuc has taken a bold step – the acquisition of a genuine 6522 chip. This tangible piece of hardware serves as a tangible bridge between theory and practice, allowing Abacuc to put the 6522 logic to the test in a real-world environment.

The grand vision that Abacuc is pursuing involves the construction of a 6502 single-board computer, a testament to its passion for microprocessors and integrated circuits. At its core, this ambitious project comprises a 6502 microprocessor, a 6522 Versatile Interface Adapter, a ROM chip, a RAM chip, and a plethora of logical components. Together, these elements will orchestrate a symphony of operations, unveiling the precise timing and control register status – two areas where Abacuc seeks enlightenment.

Taking inspiration from the ingenious work of Ben Eater, Abacuc has embarked on a journey to recreate and understand the inner workings of these intricate components. The design contemplates the utilization of a 1 MHz quartz clock, reminiscent of the original Apple 1, or an external clock module driven by trusty 555 chips – ideal for generating single-step clock pulses or ultra-low frequencies.

The heart of the matter lies in the need to comprehend the exact behavior of the 6522 chip and its pin-level statuses. To achieve this, Abacuc requires a clock source that not only keeps time but can also pause it, allowing for meticulous examination and single-stepping. Fortunately, the 6502 and 6522 components chosen are of the full static design, offering the flexibility to freeze the system at will.

In a twist of fate, the absence of spare 555 chips on Abacuc’s workbench led to a creative solution. Enter the Raspberry Pi, a versatile tool with PWM capabilities, albeit a tad overqualified for the task at hand. Within Abacuc’s drawer lay a pair of Raspberry Pi Pico W boards, which had hitherto remained unexplored. It was the perfect opportunity to delve deeper into the capabilities of this microcontroller platform.

The journey commenced with a vision of the clock’s capabilities:

– A display to showcase the current frequency, utilizing a 4-digit, 7-segment display.

  • Six physical buttons, each with its purpose:
  • Reset: A means to reset picoclock to its default configuration, with configurations stored in the main.py file.
  • Cycle: The ability to cycle the first digit from 0 to 9.
  • Shift: A mechanism to multiply the current sequence by ten, complementing the Cycle button to input frequencies from 0 to 9999.
  • Set: A button to configure picoclock with the currently displayed frequency and initiate the clock.
  • Start/Stop: A control to commence and halt the clock, allowing users to freeze the 6502 in its current state. Note: This feature is compatible with modern 6502 models with a fully static design.
  • Pulse: A button to trigger a transition from low to high and high to low on the clock output pin, facilitating single-stepping of the 6502 microprocessor.
  • The on-board LED serves as a visual indicator, conveying whether the clock is running.

As the pieces of this intricate puzzle fall into place, a glance at the Pico documentation reveals an intriguing detail – the ability to utilize PWM frequencies up to 127 MHz, a substantial leap beyond the 14 MHz limit imposed by the 6502. From an electronics perspective, this venture is straightforward. The Pico operates at a voltage of 3.3 Volts, well within the acceptable range for the 6502. However, it’s essential to exercise caution, for the 6502’s specifications dictate that it will not run at more than 8 MHz when powered with 3.3 V – a limitation that doesn’t pose a significant obstacle.

For Abacuc, the choice of development environment falls upon MicroPython. The comfort and familiarity of Python provide a solid foundation, even though the realm of engineering beckons with the allure of C. Perhaps another time, another challenge.

As software and hardware converge in elegant simplicity, the project can be up and running in less than an hour. However, a curious discovery awaits in the realm of Pico PWM. The specifications unveil the ability to produce a PWM signal spanning a vast range, from 8 Hz to a staggering 127 MHz. A stark contrast to previous experiences with the Raspberry Pi Model 3B, which called for timers at lower frequencies and PWM for higher or equal frequencies.

In a final note on the choice of Integrated Development Environment (IDE), Abacuc shares a personal preference. While a great admirer of PyCharm, it concedes that Visual Studio Code holds a special place when it comes to working with MicroPython.

And there it is – the “picoclock” – a fusion of hardware and software, where precision and creativity meet. If you’re curious to explore further, the code awaits.

picoclock
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Commenti
Newest
Oldest Most Voted
Inline Feedbacks
View all comments